623
you are viewing a single comment's thread
view the rest of the comments
[-] PoolloverNathan@programming.dev 9 points 1 year ago

I'm fine with non-braced blocks, but they must always be on the same line as the parent statement (e.g. if (a != null) return a) to visually distinguish them. (inb4 argument about long conditions: they'd usually be spread out over several lines, and the statement would go on the closing parenthese (which is on a line by itself when split over multiple lines))

We avoid that, because just at a glance you might not see the function flow change when returns are at the end of lines. It's a minor thing of course.

this post was submitted on 08 Dec 2023
623 points (96.4% liked)

Programmer Humor

32745 readers
309 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS