r/programminghorror • u/Coolfoolsalot • Sep 30 '26
Java I love loops
Working in a legacy codebase. Dozens of people have contributed over the last decade. User spotted a bug & I traced the function calls and found
for(int i = 0; i < 2; i++) {
if(i == 0) // do A
if(i == 1) // do B
}
Wasn’t the source of the bug, and it technically works fine. I love loops
802
Upvotes
View all comments
Show parent comment
4
u/4xe1 Oct 01 '26
two wrongs do make a right if you try hard enough ;)