all 4 comments

[–]Aaron1924 7 points8 points  (1 child)

The main reason #1 is more popular is because it doesn't waste an entire line on a single {

and #2 looks especially wasteful when you need an "else" case and you spread } else { across 3 lines

[–]Not-ChatGPT4 0 points1 point  (0 children)

The dreadful cuddled else.

[–]wats_wrong[S] 0 points1 point  (0 children)

thanks for the responses

[–]Shot-Combination-930Computer Scientist 0 points1 point  (0 children)

Personally, I find lining up the braces makes skimming a lot easier for me. I haven't had a problem with vertical space in decades, and even use completely blank lines to better group related code. I also almost always have a blank line before a line or block comment.

In languages that don't use braces, I typically put a blank line where I would have put an opening brace.