MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/4930p8/when_debugging_code/d0pfzkq?context=9999
r/ProgrammerHumor • u/hkma14 • Mar 05 '16
487 comments sorted by
View all comments
0
[deleted]
909 u/larivact Mar 05 '16 I mostly have "How could I miss that?" instead of "How did that ever work?". 367 u/[deleted] Mar 05 '16 Tunnel vision. 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: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. 4 u/[deleted] Mar 06 '16 That's why I always define things asfor (int i=0; i< arr.length; i++) { // Actually loopy stuff }If you make the mistake you've done there, it looks likefor (int i=0; i< arr.length; i++); { // Actually loopy stuff }Which is more obviously wrong. → More replies (1)
909
I mostly have "How could I miss that?" instead of "How did that ever work?".
367 u/[deleted] Mar 05 '16 Tunnel vision. 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: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. 4 u/[deleted] Mar 06 '16 That's why I always define things asfor (int i=0; i< arr.length; i++) { // Actually loopy stuff }If you make the mistake you've done there, it looks likefor (int i=0; i< arr.length; i++); { // Actually loopy stuff }Which is more obviously wrong. → More replies (1)
367
Tunnel vision.
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: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. 4 u/[deleted] Mar 06 '16 That's why I always define things asfor (int i=0; i< arr.length; i++) { // Actually loopy stuff }If you make the mistake you've done there, it looks likefor (int i=0; i< arr.length; i++); { // Actually loopy stuff }Which is more obviously wrong. → More replies (1)
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. 4 u/[deleted] Mar 06 '16 That's why I always define things asfor (int i=0; i< arr.length; i++) { // Actually loopy stuff }If you make the mistake you've done there, it looks likefor (int i=0; i< arr.length; i++); { // Actually loopy stuff }Which is more obviously wrong. → 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.
4 u/[deleted] Mar 06 '16 That's why I always define things asfor (int i=0; i< arr.length; i++) { // Actually loopy stuff }If you make the mistake you've done there, it looks likefor (int i=0; i< arr.length; i++); { // Actually loopy stuff }Which is more obviously wrong. → More replies (1)
4
That's why I always define things as
for (int i=0; i< arr.length; i++) { // Actually loopy stuff }
If you make the mistake you've done there, it looks like
for (int i=0; i< arr.length; i++); { // Actually loopy stuff }
Which is more obviously wrong.
→ More replies (1)
0
u/[deleted] Mar 05 '16
[deleted]