Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
pardeike2819yI converted to 2nd a while ago and never looked back. If I look at code from before I feel kind of dirty
-
Onyx16403459yI generally use the second style these days, but I'm not particularly biased one way or the other.
-
I used to be the first one, now I use the second purely because intelli j does it for me
-
nmunro31889ySecond one because I code in JavaScript and automatic semicolon insertion means that:
return
{ "code": 0, "msg": "a-ok" };
returns undefined, but
return {
"code": 0,
"msg": "a-ok"
};
works. -
Grumpy28829yWho came up with curly braces and their predecessor, begin and end, anyway?
I'm so happy I don't have to litter my code with either, when programming F# or Haskell. Indents FTW!
(Ooops, I might have just introduced a third kind of people. Next, we'll have a Clojure programmer introducing a fourth.) -
prodoxx1679yI'm both :p. Visual Studio forces me to be a person I am not :p and now I've grown accustomed to it. smh
-
ui-guy479yThe second one for sure. I can't stand the wasted near-empty lines that the first style promotes.
-
ui-guy479y@crystalclear which languages that use braces also force their placement? Most I know allow either (e.g. Java, PHP, JavaScript,etc.)
-
AsIfElse239yApparently most devs look through the file they are editing to see which one is used so far, then use the other one...
-
I was taught C/C++ by my professor who used the first way, but I was taught JavaScript by a professor who used the second way. I guess I just kind of adopted both ways depending on the language I use
I am the first one.
undefined