Click here to Skip to main content
14,603,499 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
 
JokeRe: From the Museum of Ugly Code Pin
Chris Maunder7-Nov-18 4:50
cofounderChris Maunder7-Nov-18 4:50 
GeneralRe: From the Museum of Ugly Code Pin
raddevus7-Nov-18 5:04
mvaraddevus7-Nov-18 5:04 
GeneralRe: From the Museum of Ugly Code Pin
Baraaaaaa7-Nov-18 5:27
MemberBaraaaaaa7-Nov-18 5:27 
GeneralRe: From the Museum of Ugly Code Pin
raddevus7-Nov-18 5:36
mvaraddevus7-Nov-18 5:36 
GeneralRe: From the Museum of Ugly Code Pin
Gerry Schmitz7-Nov-18 5:44
mveGerry Schmitz7-Nov-18 5:44 
GeneralRe: From the Museum of Ugly Code Pin
raddevus7-Nov-18 5:48
mvaraddevus7-Nov-18 5:48 
GeneralRe: From the Museum of Ugly Code Pin
Member 139155387-Nov-18 6:53
MemberMember 139155387-Nov-18 6:53 
JokeRe: From the Museum of Ugly Code Pin
raddevus7-Nov-18 7:25
mvaraddevus7-Nov-18 7:25 
wrote:
Your logic isn't quite the same.


Yes, others have pointed this out.
I just wrote the code sample real fast.
Now, the subtle error is bait for people with OCD. Roll eyes | :rolleyes:

Even the explanation of using the for loop in this case actually stinks the place up, because the original code writer probably didn't use critical thinking to consider that the loop will run once and then only increment to the next file after it gets to the bottom (after the first time through the loop).

I could've made it a do...while. Smile | :)

NOte: I'm not directing this criticism at you, just at any explanation of using the for loop for that reason.

modified 7-Nov-18 13:32pm.

GeneralRe: From the Museum of Ugly Code Pin
James Lonero9-Nov-18 6:38
MemberJames Lonero9-Nov-18 6:38 
NewsA weasel walks into a bar... Pin
Johnny J.5-Nov-18 23:57
professionalJohnny J.5-Nov-18 23:57 
GeneralRe: A weasel walks into a bar... Pin
  Forogar  6-Nov-18 2:20
professional  Forogar  6-Nov-18 2:20 
GeneralRe: A weasel walks into a bar... Pin
"mega"-in-a-fresh-shave!6-Nov-18 2:38
professional"mega"-in-a-fresh-shave!6-Nov-18 2:38 
GeneralRe: A weasel walks into a bar... Pin
Ron Anders6-Nov-18 2:53
MemberRon Anders6-Nov-18 2:53 
GeneralRe: A weasel walks into a bar... Pin
musefan6-Nov-18 3:22
Membermusefan6-Nov-18 3:22 
GeneralRe: A weasel walks into a bar... Pin
Johnny J.6-Nov-18 4:02
professionalJohnny J.6-Nov-18 4:02 
GeneralRe: A weasel walks into a bar... Pin
littleGreenDude6-Nov-18 3:12
MemberlittleGreenDude6-Nov-18 3:12 
GeneralRe: A weasel walks into a bar... Pin
Johnny J.6-Nov-18 3:21
professionalJohnny J.6-Nov-18 3:21 
GeneralRe: A weasel walks into a bar... Pin
kmoorevs6-Nov-18 5:20
Memberkmoorevs6-Nov-18 5:20 
GeneralCCC Pin
pkfox5-Nov-18 22:53
professionalpkfox5-Nov-18 22:53 
GeneralRe: CCC Pin
OriginalGriff5-Nov-18 23:01
mveOriginalGriff5-Nov-18 23:01 
GeneralRe: CCC Pin
pkfox5-Nov-18 23:08
professionalpkfox5-Nov-18 23:08 
GeneralRe: CCC Pin
OriginalGriff5-Nov-18 23:12
mveOriginalGriff5-Nov-18 23:12 
GeneralRe: CCC Pin
musefan5-Nov-18 23:05
Membermusefan5-Nov-18 23:05 
GeneralRe: CCC Pin
pkfox5-Nov-18 23:07
professionalpkfox5-Nov-18 23:07 
GeneralRe: CCC Pin
musefan5-Nov-18 23:18
Membermusefan5-Nov-18 23:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.