13
hcaz
8y

So, what's everyone's opinion on curly brace placement?

Comments
  • 10
    oh brother, if you adopt second one and do JS, you are in for a big surprise.
  • 9
    ++ for option one
    And
    -- for option 2?
    😋
  • 2
    @4by10 you! I like you! :D
  • 3
    Left option. Second is just...wrong
  • 2
    @KeyWeeUsr i would have liked you back, but all these exceptions are keeping me busy!!!
  • 3
    Option 2!!! I mean seriously how do you see through that mess that is option 1? :D
  • 1
    @Maverick25 good spacing, short if statements and I haven't had a single problem with it. The second is only annoying, because it breaks the style. :(
  • 3
    @KeyWeeUsr yeah I guess it depends on the style :) for me it gives me a better overview where is the start and the end..
  • 3
    @Maverick25 also highly depends on the editor too. If it highlights brackets or no, etc. And your first language is also the important thing e.g. if you learned basic or pascal, this might be the case where second style is used the most and e.g. C/C++ goes with the first.
  • 0
  • 1
    Number 2 please. Mostly because that's how VS auto formats things by default.
  • 1
    Option 1 please. :D

    And there are those with:
    if (condition){ statements....; }

    trust me, I've seen some classmates do it.
  • 3
    First every time... Less key strokes and you see exactly what the opening brace belongs to on the same line, and any good editor will syntax highlighting so you know where the brace ends.
  • 2
    I started in C. and most C89 code you see out there has the brace on a new line.

    but I typically write it on the same line now a days.
  • 3
    I tried both styles before and I stayed with the second because I can easily see where my opening and closing braces are at and can debug much quicker.
    I also sometimes do my set/get or other statements in a single line since they aren't big or that complex to understand/see.
  • 1
    super overrated. mix everything and throw into a blender
  • 1
    the first one is the only way to go, everything must stay clean and in line!
  • 1
    Option 1, if you have a choice. The extra line break annoys me and my scrolling finger.
  • 0
    As I read the opinions, there should be some converter in each sane editor with an option to choose the default style, because man, this can increase your pressure in seconds if you hate the other side...
    however, git won't like it (crappy diff).
  • 2
    @benyitzhaki there is a place in hell for people like you ;) haha
  • 1
    @KeyWeeUsr maybe there should be a bit plugin to convert it to a house style on each commit, so each user sees what they want but it's all stored the same?
Add Comment