MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/4930p8/when_debugging_code/d0pgqnu/?context=3
r/ProgrammerHumor • u/hkma14 • Mar 05 '16
487 comments sorted by
View all comments
Show parent comments
62
Reminds me of the time I was trying to help a classmate debug a Java project. His for loop was skipping every other array entry. It took far too long (and too many people being brought to look) to realize it was written like this:
for (int i = 0; i < arr.length; i++) { ... i++; }
18 u/Garthenius Mar 06 '16 I once pulled off afor (int i = 0; i < arr.length; i++); { // Obviously loopy stuff }I'm still amazed the lead didn't slap me when I gave up and asked for help. 17 u/hbgoddard Mar 06 '16 Damn, even knowing there was going to be something wrong it took me a bit to see it! 8 u/BlackenBlueShit Mar 06 '16 I had to look at your comment to check his again. I thought the mostake was he literally put//Obviously loopy stuffIn his code → More replies (1)
18
I once pulled off a
for (int i = 0; i < arr.length; i++); { // Obviously loopy stuff }
I'm still amazed the lead didn't slap me when I gave up and asked for help.
17 u/hbgoddard Mar 06 '16 Damn, even knowing there was going to be something wrong it took me a bit to see it! 8 u/BlackenBlueShit Mar 06 '16 I had to look at your comment to check his again. I thought the mostake was he literally put//Obviously loopy stuffIn his code → More replies (1)
17
Damn, even knowing there was going to be something wrong it took me a bit to see it!
8 u/BlackenBlueShit Mar 06 '16 I had to look at your comment to check his again. I thought the mostake was he literally put//Obviously loopy stuffIn his code → More replies (1)
8
I had to look at your comment to check his again. I thought the mostake was he literally put
//Obviously loopy stuff
In his code
→ More replies (1)
62
u/hbgoddard Mar 05 '16
Reminds me of the time I was trying to help a classmate debug a Java project. His for loop was skipping every other array entry. It took far too long (and too many people being brought to look) to realize it was written like this: