Re:Humans should think of sizeof() as a function, says Linus...
by michaelmior on Saturday May 30, 2015 @07:40AM
(#9629828)
{ on new lines seems to have dominated the majority of code I've worked with although I've always preferred putting it on the same line myself.
[ Parent
| on HN ]
Re:Humans should think of sizeof() as a function, says Linus...
by harkyns_castle on Saturday May 30, 2015 @08:51AM
(#9629997)
Most C++ codebases I've seen have the brace on a fresh line, most Java codebases at the end of the line (at a guess born of the Sun guidelines and default Eclipse formatting perhaps). I started with the former, but prefer the latter now.
To me its more about conserving an extra bit of vertical space... I like my methods/functions quite compact. In the past I liked the balanced nature of the braces though.
Makes absolutely no appreciable difference though of course, as long as you don't get into a formatting war with your team.
Re:Humans should think of sizeof() as a function, says Linus...
by pivo on Saturday May 30, 2015 @08:07AM
(#9629894)
I put it on the line that makes the code following it the most clear
Re:Humans should think of sizeof() as a function, says Linus...
by MrBuddyCasino on Saturday May 30, 2015 @08:10AM
(#9629903)
How do you handle auto-format? If a rules doesn't survive that, its not practical, at least for me.
Re:Humans should think of sizeof() as a function, says Linus...
by pivo on Saturday May 30, 2015 @08:35AM
(#9629960)
We don't use auto format for one because as far as I know it's not available for our languages (objective-c and swift)
Re:Humans should think of sizeof() as a function, says Linus...
by vidarh on Saturday May 30, 2015 @08:44AM
(#9629980)
I've never met an auto-formatter that I haven't hated the output of enough to not use it.
Re:Humans should think of sizeof() as a function, says Linus...
by MrBuddyCasino on Sunday May 31, 2015 @10:55AM
(#9634336)
Which ones would that be? The Eclipse one has a million knobs and twiddles, and is bearable in 95% of the time after fiddling with them a lot, which I'm okay with.
Re:Humans should think of sizeof() as a function, says Linus...
by vidarh on Sunday May 31, 2015 @01:21PM
(#9634799)
I must admit I haven't used Eclipse's auto-formatter because I've never met an IDE that haven't made me want to kill myself, and Eclipse is at the top of the list of IDE's I have never been able to stand more for than 5 minutes.