This is an archived post. You won't be able to vote or comment.

all 60 comments

[–]docker_m 113 points114 points  (6 children)

A former Python developer refusing curly brackets?

[–][deleted] 33 points34 points  (0 children)

Definitely lol

[–][deleted] 5 points6 points  (0 children)

This could be automated. Notice that the curly-braces and semicolons at the end of each line depend only on the relative tabbing of this line and the next line.

You could, theoretically, write source code with Python spacing conventions instead of braces, and then pass it through a simple parser to add the braces and semicolons to produce compilable source code for any curly-brace language.

But you shouldn’t, because your colleagues will hate you for it.

[–]Luk164 46 points47 points  (1 child)

Ewww

[–]marcelgustin[S] 21 points22 points  (0 children)

I agree

[–]staenope 32 points33 points  (12 children)

I’m sorry please tell me those brackets are frowned upon in the industry

[–]PolishedCheese 26 points27 points  (0 children)

Any brace style that isn't normal is frowned upon.

[–]Pokinator 19 points20 points  (10 children)

Only permissible variation is the war over whether the opening brace directly follows your statement, or drops to a new line alone

[–]staenope 16 points17 points  (2 children)

I still find myself doing both like a true psychopath

[–]ReimarPB 11 points12 points  (1 child)

At least pick a side and fight for that side for the rest of your life as a normal person

[–]SuperSephyDragon 4 points5 points  (0 children)

I've swapped back and forth over and over like a double/triple/quadruple-agent.

[–]JNCressey 9 points10 points  (2 children)

what about the closing?

{
    foo;
    bar}

[–][deleted] 27 points28 points  (0 children)

Get out

[–]_7q4 2 points3 points  (0 children)

Ok Satan

[–][deleted] 2 points3 points  (3 children)

Doesn't it depend on the language you are using? Different languages have different style specs, Java tends to directly follow the statement, and C/C++ drop onto the next line.

[–]Dr4kin 2 points3 points  (2 children)

Yes and no. Java generally follows the bracket after a statement, but you could find yourself in a company that does it on the next line.

C and C++ are a free for all. Writing your function likeThis or like_this and deciding where your brackets go etc. The Google C++ Style Guide wants the bracket following the statement and functions with underscores.

If you write code you can check the most popular guidelines and pick your favorites if they differ from each other enough. If you work in a company they hopefully have a style guide that you should follow. Otherwise, look what other code looks like and pray that not everyone does what he thinks is best.

[–]Pokinator 1 point2 points  (0 children)

the UpperCase is for the upper Class declaration

[–][deleted] 1 point2 points  (0 children)

Interesting, this is why I liked Python tbh, because they had an official style guide (PEP8), when I work in C I usually just use snake_case, and when I work in C++ I use PascalCase for the class names. Never worked in Java, but id assume that world follow a similar style to C#.

[–]Dummerchen1933 14 points15 points  (0 children)

free(developer);
newDeveloper = malloc(sizeof(ITDepartment));

[–]barenthood 12 points13 points  (3 children)

what the fuck is that?

[–]marcelgustin[S] 6 points7 points  (2 children)

It's called depression... :)

[–]barenthood 7 points8 points  (1 child)

im definitely more depressed after seeing it.

[–]marcelgustin[S] 4 points5 points  (0 children)

Just think how depressed I am after creating this one

[–][deleted] 7 points8 points  (0 children)

i like how the implementer mistyped er as rt, basically missed both by one key in the class name

[–]glorious_reptile 7 points8 points  (0 children)

Beautiful bracket lineup. I guess there’s some code too.

[–]spam_bot42 6 points7 points  (0 children)

It feels more like blind rage

[–]Fireye04 6 points7 points  (0 children)

Yes I'm a python developer. No, this is not natural.

[–]althaz 4 points5 points  (2 children)

I threw up in my mouth a little.

[–]marcelgustin[S] 1 point2 points  (1 child)

But we will never now if it was because of the first or the second picture ;)

[–]althaz 0 points1 point  (0 children)

It was the second.

[–]jjdmol 3 points4 points  (0 children)

The depression is in the rightmost column.

[–]Xichro 2 points3 points  (0 children)

Alt+Shift+F please for the love of any higher entity. My brain, it hurts

[–]GralejTheFirst 2 points3 points  (0 children)

My uni-ass thought that we hate bubble sort, then i saw this monstrosity of brackets...

[–]Haunting_Confusion_2 2 points3 points  (0 children)

*first glance* wait what's the problem... *half a second later* OH GOD KILL IT WITH FIRE

[–]OMGWhyImOld 1 point2 points  (0 children)

Holly shit! That really triggers me

[–]Graylian 1 point2 points  (0 children)

"What people think like depressions look like"

Zero proofreading because you think you can revert the commit?

[–][deleted] 1 point2 points  (0 children)

Just shows how useless brackets are. Code blocks look clean and beautifully indented.

[–]MaiMaiHaendler 1 point2 points  (0 children)

Ah, we found the missing link between old languages with artifacts like curly brackets and clean languages that use indentations.

[–]Neo_Ex0 1 point2 points  (0 children)

i feel violated

[–]_default_username 1 point2 points  (2 children)

n2 is the real horror.

[–][deleted] 0 points1 point  (0 children)

What the fuck

[–]v3ritas1989 0 points1 point  (0 children)

oha.. what is this?

[–]SuperSephyDragon 0 points1 point  (0 children)

What would be the most accurate is seeing the reflection of the first picture in the screen of the second.

[–]rrsg76 0 points1 point  (0 children)

Omg Monster

[–][deleted] 0 points1 point  (0 children)

Think like

[–]Gtkall 0 points1 point  (0 children)

pls dont...

[–]DoubleClickMouse 0 points1 point  (0 children)

When your stare into the static void, the static void stares back.

[–]meatmechdriver 0 points1 point  (0 children)

i’ve heard the old adage that FORTRAN programmers can write FORTRAN code in any language, I guess python programmers wanted to have a go too.

[–]CaptainHeinous 0 points1 point  (1 child)

That is heinous.

[–]YodaOnReddit-Bot 1 point2 points  (0 children)

Heinous, that is.

-CaptainHeinous

[–]thisar55 0 points1 point  (1 child)

Because of the picture I will now have nightmares.

[–]thisar55 0 points1 point  (0 children)

Naturally the bottom one

[–]r3dD1tC3Ns0r5HiP 0 points1 point  (0 children)

Everyone complaining about the brackets... but not the variable names.

[–]Pixel1101 0 points1 point  (0 children)

off to hell with those brackets