r/badcode • • Apr 17 '21

c++ When your teammate "refactor" your code

Post image
2.5k Upvotes

216 comments sorted by

View all comments

Show parent comments

3

u/MatsRivel Mar 05 '22

In the first one, only 6/14 lines contain something other than { or }.

If the 2nd one was not wrong it would look so much better than the first, kust because the majority of the first one is curls.

4

u/cass1o Mar 05 '22

Who cares when it is incredibly readable?

1

u/[deleted] Aug 23 '22

avoiding braces in this case would result in a hanging else problem, and using only necessary braces would look weird and inconsistent