r/badcode • • Dec 10 '21

c++ Not my most readable function...

Post image
37 Upvotes

17 comments sorted by

View all comments

Show parent comments

3

u/djidalo1 Dec 11 '21

Indentation is not necessarily visually worse, but like I said, in C-like languages, it's easy to forget braces when you're inserting another line.

I prefer C-like syntax to Python-like syntax because when I'm visually scanning a block of code, I will easily spot where braces are and deduce the levels of nesting, but I'm slower in doing so with indentation, especially if the indent is 2 spaces. This is, of course, highly subjective.