good. article upvoted. as are also good curly braces after if/else. too many times I’ve seen if/else without curly braces. why I should carefully read tens of loc, to find ifs? why can’t I find it at a glance, quickly scrolling the file? y do i have to read the line horizontally too to understand if the instruction is there or in the following line? why do I HAVE to add the curly braces to fix stuff? juniors get arty with this “feature” and unwrapping their logic becomes a real pain: but it looks so good!
well, in my rant, the bit about why do I have to add braces to fix stuff is very close to your first point, and the bit about reading while quickly scrolling to your second point, in which you say the right thing: not adding braces is something that one actively does. with no acceptable reason ever, imo.
My points are related to provable advantages to doing it while writing code. They’re also not argumentative.
Your points are related to a personal preference of aesthetic while reading code. They are not provable advantages. They’re also quite “ranty,” which is rarely a persuasive way to convince someone of your position.
If you actually want to get people to change their habits around this, I think you’ll have better luck with my approach than ranting about why you don’t like how it looks.
good. article upvoted. as are also good curly braces after if/else. too many times I’ve seen if/else without curly braces. why I should carefully read tens of loc, to find ifs? why can’t I find it at a glance, quickly scrolling the file? y do i have to read the line horizontally too to understand if the instruction is there or in the following line? why do I HAVE to add the curly braces to fix stuff? juniors get arty with this “feature” and unwrapping their logic becomes a real pain: but it looks so good!
I agree with the need, but not your rationale, I’m in the “always curly braces” camp for two reasons:
well, in my rant, the bit about why do I have to add braces to fix stuff is very close to your first point, and the bit about reading while quickly scrolling to your second point, in which you say the right thing: not adding braces is something that one actively does. with no acceptable reason ever, imo.
Well, a couple things:
My points are related to provable advantages to doing it while writing code. They’re also not argumentative.
Your points are related to a personal preference of aesthetic while reading code. They are not provable advantages. They’re also quite “ranty,” which is rarely a persuasive way to convince someone of your position.
If you actually want to get people to change their habits around this, I think you’ll have better luck with my approach than ranting about why you don’t like how it looks.
if aesthetics reason is what gets through, I’m really lost then. for sure that’s a rant. thank you, have a nice day