Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple APILearn More
Pointer33725yAs far as I'm concerned, for me, it's language-dependant.
When I'm codign:
- Java : Same Line
- PHP : Next Line
- C++ : Next Line
+ Python: Look mom, no brackets!
I put mine on the same line because I think putting it on the next is visually redundant; the scope starts at the indentation level of the declaration. You don't need to say it again with a bracket.
I assume people put the bracket the next line to increase readability. I just add a blank line after the declaration if it's hard to read.
if you want some more action, gnu styling guide recommends writing the return type to a seperate line like:
i like philosophy and works of fsf but, just... why?
I'm a new line guy, but the Swift standard is same line and rest of the team want to stick to that, so i've had to sell my soul to the devil and become a same liner.
I can see a noticeable difference in readability (negatively) from switching. I'm a fan of of breaking things up so its easier to scan.
And I don't like trying to match one curly brace with the start of a function. For me its very painful to try match 2 unrelated symbols together, mentally its easier to match 2 curly's than 1 curly and an alpha.
PS: theres also same liner's who put an empty new line afterwards. They are just anarchists who want to watch the world burn. No justification for that shit.
@DLMousey you may not use "this" in static methods.
Same line, every time. I hate when I'm reading code and the bracket gets its own line, just put a blank line in there and keep the bracket on the same line.
xjose97x16Just saw a variable in C named like this: long time_ago; //in a galaxy far away I laughed no stop.
elgringo34Student - Teacher renaming .c to .exe make the program executable ? Teacher - Yes A group of people stand up...
Cyborg17A guy and a girl are in a Java seminar. Afterward, the guy approaches the girl and asks, "Hey gurrl, can I ge...