Why is Allman usually not the bracket/indent style of choice?
It makes more sense, helps visualize nested code and looks more symmetric.
>>56866910
Fuck off pajeet
>>56866910
because most people don't care to brag about loc.
K&R is the one true brace style you blasphemer.
Allman is better but javascript monkeys can't use it because
return
{
foo: bar,
}
does not work (I think the interpreter inserts a semicolon after the return statement)
>>56866927
Actually, one true bracket style is the one true brackrt style
All hail 1tbs
>>56866910
because it adds a shitton of unnecessary lines and stretches out the code, if I want to add a blank line for code readability I'll do it myself
>>56867068
in the old times they used shitty brackets because they needed to print out the code you dumbfuck but now we dont have to spare lines.OP is fucking right.i'd rather have a readable code than stroke my cock to "hahaha my spagetti code is only 20000 lines while yours is 230000 hahahahahahha".
Allman >>>>>> everything else
K&R style is harder to read
>>56867625
>>56867437
one day, you might join the forces of real programmers, and you will see how young and dumb you were
>Why is Allman usually not the bracket/indent style of choice?
But it is in the only language that matters nowadays, C#.
>>56867437
>tv licence
>>56867437
>>56867828
>tv detector vans
>search warrants
>licences are half price for the legally blind
holy shit
>>56867780
>x is better because most people prefer it
>>56867437
>admitting to being a shit programmer
Opinion discarded.
>>56867437
finally justice after 2 years
http://www.mirror.co.uk/news/uk-news/rotherham-child-abuse-gang-victims-7451450
>>56866917
this,if (PAJEET){
pooInLoo();
}
still makes the block scope obvious
>>56866910
Because people are retarded that's why. They do not know how to press enter before and
>muh extra line
>>56866910
>Not using superior style
>Used by authoritative projects such as systemd
this may seem weird but i like keeping my braces like this
int dumbfunc(bool shit)
{
if (shit)
{ return 42; }
else
{ return 7; }
}
void Foo()
{
if (Butts) Something();
else Bar();
}
2bh
>>56868138void Foo()
{
Butts ? Something() : Bar();
}
>>56868157
sure that too.
>>56868101
>it's actually real
No wonder pootterring is only capable of making the most ridiculously bad software known to man.
//function definition
int
main(int argc, char *argv[])
{
//if statement
if(expr) {
//code
//code
}
if(one_line)
//code
return 0;
}
>>56869361
THANK YOU.
>>56868101
Goto fail u fucking moron
>>56869361
>one line if with statement on a new line
Not a good idea
constructor(
private ButtService: Butts.IButtService
){
this.Butt = ButtService.GetButt();
}
>>56869361
Fuck off retard
>>56866910
>not using ternary operator
Seven line statement, which should take no more than one. Plebs everywhere.
>>56869361
>not all code paths return a value
>>56866910
const foo = a => pajeet&&(pooinloo()); !pajeet&&(bar())
>>56870172
nigga stop this evaluation abuse shit a ternary is better than this
>>56870056
I only ever use it when assigning to a variable.
(defun foo () (if pajeet-t (poo-in-loo) (bar)))
gotta be OOP
let foo = new Function('{true: Pajeet.pooInLoo(), false: Pajeet.bar}[new Boolean(Pajeet)]')
>not void poo()
>>56870519
Where is the function factory service???
>>56870105
But they do you fucking retard.
K&R with Egyptian brackets for Java and Javascript
Kernel style for C and C++
Anything else and you should seek intercourse.
>not writing all your code on a single line to make it more efficient
>>56867437
>youngsters are also asked whether they feel safe using single-sex toilets
That's why there are toilets for the disabled in pretty much every school. Why don't they just fucking use them.
>>56866910
I think we can at least all agree that kernel style is degenerate as fuck.
>tabs out to 8 characters
>nl brace for functions, everything else is K&R brace
>except single line conditionals, which are just one line
At least they got column width right, but jfc
>>56869361
one liner ifs should really be done if you are certain that they would never change, like maybe in some small math function. Otherwise you're just making more work every time you need to add extra statements for that if.
>>56872669
nl brace for functions IS K&R you goof. Also 8 character tabs is there to force people to write readable code. If there's too much nesting linus doesn't want it. It all works out because there's only one person who makes the decision if something passes or fails.
>>56868101
>single line if blocks should not be enclosed in {}
hahaha, oh wow
Doesn't linux kernel coding style mention exactly the same case and says you should like it's suggested in systemd only if you're trying to something very shady?
>>56867625
why is it harder to read, wasting a whole nother line for a brace makes the program itself harder to read because it will require more scrolling.
Is it bad that I purposefully write all my if, for and while loops in a single line so as to do everything without the use of brackets?
>brackets
ew
Superior Haskell master race here.
>>56873208
Because the name and the body of the function are seperated much more clearly. The name and the parameters are on one line and the body starts on the next line, not on the same line. Pic related
>more scrolling = harder to read
That's not what harder to read means. That just means that you have to scroll more (1 line, which is fucking nothing).
>>56866910
Allman only works for tiny programs. As soon as you start working on bigger projects than your everyday /dpt/ console program, the Allman style becomes unbearable.
>>56874042
>(1 line, which is fucking nothing)
also 1 line for every conditional
>>56874042
checkmate atheist
void function(int argument){
Logic();
}
I used to do this shit until I realized that wasting whitespace for no reason is fucking retarded
it's the same as lining up all function/method arguments on top of each other
don't do it you fucking cunt
>>56866910
It's harder to read thanvoid foo()
{
if (PAJEET)
{
pooInLoo();
}
else
{
bar();
}
}
>>56876497
*thanvoid foo() {
if (PAJEET) {
pooInLoo();
} else {
bar();
}
}