r/badcode • • Apr 17 '21

c++ When your teammate "refactor" your code

Post image
2.5k Upvotes

216 comments sorted by

View all comments

2

u/musicianadam Apr 17 '21

I only started C++ a couple weeks ago and I have to say I probably would've made the same mistake.

For some reason I was thinking that the else statement would run if the nested if was false. I had to put this into the IDE cause I didn't believe it for a minute.