27

OMFG if I see one more single-lined if-else/for statements without proper closure brackets I'm gonna kill some people!!!

Comments
  • 3
    Lol I do that sometimes. Only for simple if statements though. Anything complex gets broken out because it would be a nightmare to debug.
  • 5
    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.
  • 1
    When you've spent months working in Python during work time and Clojure in your down time, you tend to forget curly brackets denote scope...
  • 0
    @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.
  • 4
    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.
  • 0
    I use ternary operators for simple if-else, is that also bad?
  • 0
    Why so much hate?
  • 0
    Am in gonna be killed?
Add Comment