Let's settle this once and for all

Let's settle this once and for all

Attached: 0.png (295x242, 30K)

Other urls found in this thread:

imdb.com/title/tt0091183
twitter.com/NSFWRedditVideo

cond ? foo : bar;

Doesn't matter, the standard you choose to use in the field largely depends on the company's preference. I believe Googles programming standards go with A. I used to prefer B, but the last few years I've been using A.

people who unironically do B are psychopaths and are not to be trusted

What he said also what said but for people choosing A.

based

Attached: 1560202206541.png (319x478, 146K)

> }
> else
> {

and for that reason A

>hurr durr, but ternary operators exist

Only works in certain conditions. Sometimes an if-statement can require a fairly complex set of instructions which wont fit in a turnary unless they can be neatly packaged in their own function, which isn't always possible. Works great for variables, which are not booleans, but only have two options in the flow of logic.

Explain. This is how it is supposed to look and enables neat outlining of if-else blocks in VStudio for instance.

>"Sometimes an if-statement can require a fairly complex set of instructions which wont fit in a turnary unless they can be neatly packaged in their own function, which isn't always possible"
>not mixing ternary operations with anonymous functions to replace if/then/else blocks

Attached: 1553972107256.jpg (221x213, 15K)

Reminds me of:
Code written by beginners, everyone can read and understand immediately.
Code written by people of intermediate skill only THEY can read and understand.
But code written by masters, even a beginner can easily read and understand.

Creating job security by code obfuscation and use of as many syntactic constructs as you can imagine (just to seem a cool code guru) are both equally moronic. Same obviously goes for use of 'patterns' just for the patterns sake and many other similar 'techniques'.

if (Condition)
{ Statement
/*
...
*/
}

it looks disgusting and is harder to read and was popularized by a gay dude (seriously)

I like A

While I certainly don't mind the gay bashing, it is way easier to read for me. Especially when being confronted with those 10k lines functions and a nesting depth of 10 that my colleagues love to produce. With this style I can click those little [-] and collapse the block content but still have the code FLOW clearly visible.

In the end it is a 'to each his own' thing and I have formatting rules that 'fix' my colleagues code for me. Must have a good merge tool and you are set.

>not mixing ternary operations with anonymous functions to replace if/then/else blocks

is this copied from a big brain meme?

wtf is this

I prefer A, but it doesn't really matter since it is fine as long as your spacing is correct and your iq is higher than 20.

sorry to hear that your colleague is retarded

We are a company with 5000+ devs and I would say the clear majority are retarded... It's just how work life is...

>was popularized by a gay dude (seriously)
what his sexual orientation have to do with anything? Are you retarded user?

Well fuck you, I've been doing it like B forever, talk shit like that again and get shanked

If the editor collapses the function in one line it's A, if I'm using notepad its B

Remember he uses style A, so uh, you know.

in good languages like lisp there's no difference between statements and expressions so your if statement is the same as your ternary operator

Made me laugh hard, that is the best way!

Horstmann style

b for me, easier to see at a glance

You are sick. Who writes like that? What happend to you??

>let's settle this once and for all

I'm not quite sure I know what you mean, my friend and original poster. Please do not get me wrong, this is an interesting thread filled with interesting topics about interesting ways of coding, but I am entirely unable to come to the conclusion that I am able to decide which. I am a man. I code how I like. It's quite nice coding, or, at least that is what my boss tells me.

Some days I am unsure as to whether he is lying to curry favor, but I do not spend much time dwelling on such insecurities. work for my boss is nice.

It is possible of course, original poster, that the technology might one day exist that will allow a person or persons to "merge" with a computer in such a manner that they do, for all intents and purposes, "settle this once and for all", but that in itself carries with it a myriad of issues. Can a being be, in a sense, two beings? If one makes a post, can one simultaneously be that post and the post below theirs? If so, the person below them who made that post, does one immediately share a consciousness with that person, being that both persons are simultaneously that post?

Sadly however, I have so very few answers for these questions, original poster. Perhaps some time when you're around, I would enjoy discussing these with you.

Attached: 1.jpg (1267x931, 102K)

its a mental illness, fact

checked and fucking goose pilled.

>irony, the post

A is better

B is my choice

String gooseIsLoose;

if(goose==loose)
{
System.out.print(gooseIsLoose);
{
else
}
System.out.println("The goose sadly and regrettably tight");
System.exit(0);
}

I've used both and like them equally as much. I try to adapt to whoever I'm working with's style so they don't whine and shit their pants.

how can one man be so based?

A

I only use B when defining functions. I use A for almost everything else.

Syntax Error at 'else'. Expected Statement or '}'

for (ip=kwtab; (sp = ip->kwname); ip++) {
i = 0;
while (*sp)
i =+ *sp++;
hshtab[i%hshsiz].hflag = FKEYW;
}
while(!eof) {
extdef();
blkend();
}
outcode("B", EOF);
strflg++;
outcode("B", EOF);
fflush(obuf);
fflush(sbuf);
exit(nerror!=0);
}

this is from the unix source code. you can easily look it up. when learning C at my university, some little shithead also said that using break statements was poor form and i referred him to the unix v6 source to show that it was FULL of breaks.

the proper way is A, and two-space indentation. that's the true master race.

whoops, my bad.

String gooseIsLoose;

if(goose==loose)
{
System.out.print(gooseIsLoose);
}
else
{
System.out.println("The goose sadly and regrettably tight");
System.exit(0);
}

C?
looks like java but what would be the value of kwtab or ip?

This is strange and makes me feel uncomfortable ha

just scrolled down and read the rest. nailed it

condition * statement || other

>good language
>(((lisp)))
kernel cripled

C.

statements if Condition

D.

if (Condition) Statements;

E.

func x
| condition = statements x
| otherwise x

I use A, but B I guess breaks it up a bit.

LOOSE

if(condition) hello()

Attached: DTj4htuVoAA7SKe.jpg (1024x1024, 170K)

The former so A.

I use A. That's how I am used to write it.. but I don't get mad if I see the other version.

Attached: Screenshot_20190520-121329_Gallery.jpg (1422x1259, 455K)

B 100%

B

The only thing I get angry at and it's not necessarily bad is code from indians or pakis who obfuscate their stuff on purpose. It's annoying but also very profitable when I get called in to fix their dishonest shit so I don't complain too much. A lot of companies are retarded so think H1Bs can actually do things better than Americans, it's an old joke.
Instead of paying once to have something done once properly in the first place it's better to pay three or four times for corrections.
It keeps the budget up.

B

Most retarded faggots have no understanding of how budgets work at real companies.

B.
It just looks boxier and indentation is more clear.
Especially in Visual Studio

Look into the movie Head Office (1985)
It's more true than most of you lazy fucks will ever know.
imdb.com/title/tt0091183
It also has a good soundtrack.

VS sucks cock, MS lost it after v.6 when they started trying to be everything and the kitchen sink.

I'd love to do B, was forced to use A. I'll just do B and auto format before comitting anything tho. I rebel.

My man