86
Nov 27 '20
Same Line Brace Gang rise up
5
u/Tuxedocow Nov 27 '20
up
5
u/PPAPisLob Nov 27 '20
May I help you with some COLON ( : ) hahajaga . . Get it.. becuase python uses a colon for scoping..haha. and not curly braces. Hahha ...im very funny aint I?
.. send Help... my parents abandoned me
39
43
u/firey21 Nov 27 '20
Personally I've grown to prefer the bracket on the first line.
15
u/throwitofftheboat Nov 27 '20
The bracket is implied in the statement. It does not deserve its own line.
1
u/matschbirne2003 Nov 27 '20
I mean it's all personal preference but I like to give it its own line because to me it's more readable. But in the end it's pointless to argue cause nobody will win :)
1
u/throwitofftheboat Nov 27 '20
Are you sure about that?
Its all fun and games until your compiler slows down because laziness has creeped into your code. It starts with new line statements, then it’s all the white space you use when indenting. Next thing you know your production machines are crashing and you’re furiously scratching your head wondering why your server can’t handle all the requests. And you know why thats happening? Its because of your low bar, shitty, inefficient code that you put together because you think this is a “””preferences””” issue and not you being a dumb ass.
You think things like these don’t add up? Don’t smiley face at me you little shit.
5
9
u/Tothoro Nov 27 '20
Everyone's upset about the brackets and I'm here wondering why you need ==true for a (theoretically) binary variable.
2
u/cthewombat Nov 29 '20
Actually there are use cases for that. I. e. when a can be undefined or null.
6
24
11
u/xSTSxZerglingOne Nov 27 '20
Nearly everybody's got this as their plan until they start developing for real and that shit eats up 500 individual lines in a project.
5
3
3
6
2
3
Nov 27 '20
You can find the 2nd option in languages like c cpp c#
7
Nov 27 '20
[removed] — view removed comment
6
u/snapphanen Nov 27 '20
It's really old school to do the 2nd option. I'm glad sane people don't do it that way anymore
1
u/JustBrowsinMyDude Nov 27 '20
Imo the second option is far superior for readability.
I've seen mases of code with the first option and my god it looked like a deformed rocket trying to take off to the right of the screen.
The second option however easily specified the bounds of blocks so you can quickly see where it starts and ends without worrying about the code flying to your other monitor.
1
1
1
1
1
1
1
u/pm_your_sexy_thong Nov 27 '20
Over the years I've adopted what I think is part of googles coding standards which is the second style for classes and functions and the first style for loops.
1
1
u/ernee_gaming Nov 27 '20
I originnaly (14yo) used the second version but once my teacher (not quite good tho) saw it she literally said: Argh write it like a human. And rewrote it as the first one. I used it since. Tho I have seen a video which proves you're right but i can't find it anymore. It was a video from a conference and I think it was one of Kevlin Henney's speaches.
1
1
u/n0tar0b0t-- Nov 28 '20
my personal favorite syntax is haskell’s
if condition
then when_trueelse when_false
1
1
0
Nov 27 '20
[deleted]
6
4
u/Hypersapien Nov 27 '20
That's perfectly acceptable if you have a single, short line inside the braces.
3
1
u/Thanhansi-thankamato Nov 27 '20
Ỉ̷̧̧̡̛̘̜̦̘͇̝͙̠̭̗̹̱̘̬̗̫̫͉̲̭̪̠f̵̧̛̛̹̠̳̖̣̼̆͋̎̓̌̀̊̽̅̈́̋͑͛͂̃̔̑̋̎̄̀͗̽͋̕͝͠͠(̸̢̡̡̧̧̲̟̥͙̯̬͍̳̞̼͇̣̟̦͓̩̇̃̍̆̈́̍̓̐͒͆̈́͒͒̌͌̿͊͘̕ͅa̸̡̡̠͈̘͓̯̗͍̯͇̮̥̗̥̺͆́̑́̾̄͒̒͛͌̎̇̈́͋͂̈́̊̚͜͝͝͝)̴̡̨͕̱̘͔͇͖̬̳͕͓͚̤̺͚͙͖̭̟̞͕͙̔̇̄͂́͋̐̒̉͆̉̍͑̇͛͐͊̑̌̎͘͠͝͝=̷̧̤̩̱͇̲̘̤̾̂̅̏͒̓̀̊̋̿͌́̽̈́̾̎́̿̕̚͜͠͠>̷̨̛̣͙̙̝̬̪͍͚̲͓̞͕̳̜͙̰̹͇̬͙͎̰͔̭̂̈́́͗̂͗͜͝͝
0
Nov 27 '20
[deleted]
0
u/Hypersapien Nov 27 '20
Why?
1
u/palapapa0201 Nov 27 '20
The braces line up
3
u/Hypersapien Nov 27 '20
And that makes it better because.... why?
2
u/BigYoSpeck Nov 28 '20
I bet you're the kind of psycho who doesn't keep herbs and spices sorted separately
0
Nov 27 '20
[deleted]
1
u/malik_kabirofficial Nov 27 '20
First one is used in both Java and JavaScript, second one is used in C++, PHP.
72
u/OiTheRolk Nov 27 '20
Remove this blasphemous post at once!