9
ZioCain
6y

My fights with other devs always revolve around the position of curly braces:

Should they be on the same line or should they have a whole line just for themselves?

I mean, if they go on the same line you have less lines of code and you can fit more into the same view, but putting them on a new line makes it all a little less messy

Comments
  • 0
    Agree!
  • 0
    Wrong! New line, let's fight.

    Actually for me it depends on the standard for the language. In JavaScript I'd have it on the same line, in C# I'd have it on a new line.
  • 0
    @LynxMagnus I just hate when the editor puts the bracket on the new line. I want to be able to read as many line as possible.
  • 0
    Always, what’s easier to read

    To me a new line
  • 0
    @FitzSuperUser damn, I wish I could just downvote you without reporting you LoL
  • 1
    I'm quite sure that most styleguides suggest putting the opening bracket in the same line, and the closing one in it's own line, but i prefer to put both in their own, separate lines. I find it way clearer
  • 1
    I do it depending on signature/number of parameters. If it’s a simple conditional or method/function, they’ll go on the same line, if it’s a large object or a method that takes several arguments, then

    it (
    can,
    sometimes,
    end,
    up,
    like,
    this
    ) {
Add Comment