Which one are you?
Which one are you?
Left, when you're starting out.
Right, after you get on your first big codes.
Left, 'cause I want that compact shit.
Depends on the language, style guide (if any) or code base.
Doesn't matter because any modern IDE worth a damn will let you peak few lines around the beginning and the end of the brackets
this. anything else is jobless neet tier
right
love white space
simple as
Wrong. You want to maximize the information displayed on a single screen without scrolling.
Left.
Why put meaningless whitespace in the
middle
of your
code
?
Honestly I prefer the one on the left because I think it just looks better, but I feel like the one on the right is more correct and has some advantages, for example you can comment out the conditional more easily on the right side. But I think it looks ugly as sin so...
Left and anyone who disagrees is trolling or autistic.
When your eyes try to detect the start and end of a block of code, which symbol they find doesn't fucking matter. It's absolutely enough that there's any kind of symbol at the same indentation level
right. start brace and end brace should be on the same level of indentation. i just prefer that
shoot me
left because indentation is enough information
Allman style is for pajeets who need to pad their LoC count for their pajeet managers.
>tfw randomly use both
what am i?
>two brace styles
That sure would make things simple
a normie
I prefer the left one for compactness.
Whichever fits in with the coding style of the project I'm working on. Left side for my own stuff
left for sure man
loc doesn't include empty, punctuation-only, or comment lines. Both of those would be considered 2 lines
None because I prefer to not have a space between the operator and the parenthesis.
left for everything except C#
Neither because python.
Right: C++ / C#
Left: everything else
first one because that's what it says to do in the style guide
I just follow what the standard is for the language, for example
left: Javascript
right: C#
also, python whitespace scope delimitation BTFO
Left for classes and functions and simple things. Right as soon as we get to nested conditionals/loops so I don't get confused, particularly if I'm working in an editor that auto-closes braces and I'm too lazy to turn it off.
Or always right as one defensive strategy among many if I'm working with other people since it makes it harder for them to fuck up my code.
Having strong opinions on this kind of shit is for baby nerds. Do whatever facilitates your work best.
I follow the already established rules of whatever I'm modifying.
If I am to establish the rules myself, it goes like this:
1. One-liners will be one-liners, no matter the { or } involved
2. Functions, classes, switches and all other structures where "interior" code is distinctly separate from "outside" (scope, dense branching, etc.) --- right
3. If statements, assuming they are simple checks and not the above --- left
I don't think too much over it, it just happens naturally. In fact this is probably the first time I ever thought of this, been coding for over 15 years.