On which team is Jow Forums?
Brackets
>php
Hard pass
Parentheses only
teamOne
the only valid answer
teamTwo only
fuck your "space saving"
This, it's easier to read.
the kernel team
First of all, those are not brackets. They're curly braces.
Second of all, I use a language that doesn't use them to mark blocks of code.
based
teamOne but no space after the brackets because it's extra work for nothing.
follow the project guideline
else I apply firefox style with tab == 4 space
Python indent sensitive scoping
This
obviously
What current project uses.
teamOne, because it's more elegant and compact.
Team one
Based on language conventions, either of the first two.
For oneliners third is also acceptable in some languages
If I had three functions that just return something sitting right next to each other like that, then I would use teamThree for them. Generally though, I do teamTwo for classes and functions and teamOne for everything else.
I use the same line for everything if the language requires braces. Also an actual tab or two spaces for indentation.
Four spaces are for boomers.
>two spaces
Fucking based.
I really hate how everyone has to break everything into teams anymore.
#teamIndependant
imagine being team 3
This, it's more readable when not mushed together
This
anyone that isn't teamOne deserves to be hanged in public
Based centrist
team_one, you mean
first team, best team
Team two
I like the symmetry, and it helps seperate the function header from the body, makes it easier to read
team two is less symmetric than team one.
>team one, three lines
>the statement is dead in the center
>the content it is wrapped by the first and the last line is symmetric.
>team two, four lines
>the content starts in the third line which is below the center line (the one between he lines two and there), so the weight isn't in the center but rather closer to the bottom.
>it takes two lines to declare a function but one to close it
>these two first lines have characters aligned to the left, while only one in the end has a character aligned to the left
team two just hurts my eyes, how can you call that abomination symmetric? since we see code in blocks, you might as well just do this for a true symmetric effect
public function teamTwo()
{
return $this ->belongsTo(Team);
}
but teamone is overall less autistic
no, bTeamOne
this
Allman/BSD style is how you should write function definitions.
K&R style is better suited for function calls when you have very complicated parameter expressions.
AHEM
teamTwo is retarded
autistic people don't count
teamTwo() is obviously the only acceptable answer. If you're new or slightly ill in the head then teamOne is expected but teamThree is filled with fucking psychopaths and child murders.
we want the python audience
Team two
- The curly is always in the same place which means you don’t have to look for it (following rules is more efficient than searching, this goes for anything)
- You can copy the function header somehwere and change it to a call of that function without ending up with a curly at the end which doesnt belong and breaks your code
teamFour
By the way, if anyone has more examples or projects on this, I'd appreciate seeing it.
The text in this image was formatted automatically but I freaking love it.
@NPC70231093
what the FUCK is this abomination
void function()
{
if (cond) {
/*
if your language of choice has namespace blocks or lets
you define functions inline, it's trash
*/
}
}