I personally like to start the curly brace in the same line because it seems natural and complete. ;) I don't know if what I said makes any sense.

👆Which one do you prefer, left or right, and why?
I prefer the left one, because it looks more expressive !!
I don't think this is the kind of thing we should pick a side on universally. It depends a lot on the language ecosystem and community. What is the accepted style guide? For example, when I was working in the C# world, I noticed people almost always preferred the curly brace on a new line but when I moved to writing JavaScript code, it was almost aways the opposite.
Right for sure - I think it looks cleaner and reads easier 😀
For me it's right ! Less lines of code finally. And with an one line statement, no curly brace for sure.
I prefer my curly braces to start in the same line, where it belongs!!! I used to be a lefty, but things change and I changed. Now I can't think of my life going back to left! With my increasing OCD, in most of code reviews, I tend to point this out to developers and make them do the same.
I prefer the opening curly braces to be on the same line. I just like how it looks a lot more than it being on its own line.
It depends which language I am using. If I am writing JavaScript I start the curly brace on the same line. If I am writing C#, Visual Studio tries to auto-format the curly brace on the next line.
Most places you work you will find there is a coding style that developer use. It can be loose or strict. I have always tried to conform to what everyone else does unless they are doing something stupid.
The most important thing is to try to format the code so it is as readable as possible so the next developer can easily read your code. 80% of development is maintaining code someone else wrote.
Coding Styles
Some people prefer the symmetry of Allman style whilst some people prefer the neatness of K&R style.
Personally I prefer K&R, and technically it's better processing due to the reduced whitespace. Similar to tabs being better than spaces for processing (Can't remember the citation for this.)
It depends on the environment: I got used to 'right' because of JAVA and I think it looks neat
Personally, for control structures like if both are fine to me. For classes and methods I like to put them bellow, to avoid the symbol to be "glued" to other symbols, making it easier (for me) to scan the page.
However, in real life (work) I really can't go writing code like I want to. It's usually best to follow the style that is already in place in the project. That's often the language's default style. I even had to learn to ignore style mistakes (in code I'm not touching at the moment), otherwise I would go crazy and waste my time trying to fix everything at once.
Conclusion: it's fine to have preferences. But be flexible! Otherwise you'll waste your time and people will get angry at you :D
i am waiting for the python guys :D .... about the topic ... that's what code formarters are for :) i leave it to any other person who actually still cares about this topic as @maruru i am coding in multiple languages and in multiple companies / open source projects i don't want to waste time with such topics anymore :)
I try to adapt the PSR2, since I'm using the left solution
I am as flexible as a chewing gum :D
While I grew up with "left" in Delphi, PHP, C++ and C#, I do see a trend towards right with JS, Rust and Go. So I use both, depending on the language I write, though I wouldn't be surprised if I started writing "right" in a "left" language, like C++. Actually it sometimes happens, that I mix them up. However, I want to have a perfectly consistent style throughout the whole source of my program, so I usually go and fix it right away.
Sailendra Chettri
Tech enthusiast
Left one