Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Lol I do that sometimes. Only for simple if statements though. Anything complex gets broken out because it would be a nightmare to debug.
-
In my opinion, less is more when it comes to curly brackets and short ifs, especially when the only thing you do is return or throw.
Having more curly brackets just inflates the code artificially in those cases Imho. -
nmunro31888yWhen you've spent months working in Python during work time and Clojure in your down time, you tend to forget curly brackets denote scope...
-
@Firedragonweb I personally think that the cons outweigh the benefits. I prefer my program to be as precise as possible. It's not like Python where indentation is mandatory, so statements like this tend to create silly bugs. It's also kinda annoying to guess when the statement is ending without proper closure.
-
Worst thing one of my code monkeys did with this was, I shit you not,
if(condition) code1;
if(same condition) code2;
...
if(still the same condition) return true;
because "Curly brackets aren't as readable"
So, yeah, I'd be happy if they'd just throw it out.
Related Rants
OMFG if I see one more single-lined if-else/for statements without proper closure brackets I'm gonna kill some people!!!
undefined
404 curly brackets not found
fuck this shit