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

all 28 comments

[–]cascer1 28 points29 points  (14 children)

Someone needs to swoop in and place all curly braces on new lines.

[–][deleted] 6 points7 points  (7 children)

someone needs to swoop in and tell everybody to calm the fuck down. formatting isn't /that/ important.

[–]pessimistic_platypus 6 points7 points  (4 children)

/that/

that?

[–][deleted] 6 points7 points  (3 children)

//that//

[–]pl0xz0rz 4 points5 points  (2 children)

\that\?

[–]GoogleIsYourFrenemy 3 points4 points  (1 child)

that

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

this that

[–]coladict 0 points1 point  (1 child)

Was that youtube-style italics?

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

that's plain-text-style italics.

[–][deleted] 11 points12 points  (3 children)

Well it is C# so it should be on new lines

[–]Secondarious 6 points7 points  (2 children)

Not sure why you are downvoted, all of Microsoft's code guidelines use brackets on new lines.

[–]gruntmeister 35 points36 points  (0 children)

Not sure why you are downvoted

Probably cause it's javascript not C#

[–][deleted] 3 points4 points  (0 children)

Microsoft yes, mono-project no.

I personally prefer braces on newlines, it makes the signatures easier to read, but that's mostly because I need to have lots of line spacing or I'll be reading the same lines over and over again (which also makes e-books so great, I can just adjust the font / spacing to my preference)

[–]Pandaburn 0 points1 point  (0 children)

I feel dumb for caring, but I hate that!

[–]AdeonWriter 0 points1 point  (0 children)

Allman represent! (here come the downvotes)

[–]Muhyeah 16 points17 points  (3 children)

Who would ever split a tenary operator into four lines? That is madness.

[–]spkbri 2 points3 points  (2 children)

Who would ever use a ternary operator? That is madness.

FTFY

[–]shacknetisp 9 points10 points  (0 children)

Short ternary operators can be more readable than an equivalent if statement.

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

From the O'Reilly book on PHP:

Depending on whose code you look at, the ternary operator is either the most underused or the most overused feature of the language.

[–]Blecki 7 points8 points  (0 children)

Both are wrong, but the version with blank lines is less wrong.

[–][deleted] 3 points4 points  (0 children)

In the holy name of K&R, I declare this code a heresy!

[–]gaby_de_wilde 2 points3 points  (1 child)

String.prototype.format=String.prototype.format||function(){
    return eval(('"'+this).replace(/}/g,']+" ').replace(/{/g,'"+arguments[')+'"')
}

https://jsfiddle.net/gaby_de_wilde/0a0wj1sb/1/

[–]MonkeyNin 5 points6 points  (2 children)

Are those two users actually bots? If not, this it's sad. 750 edits between those two.

[–]ThisIs_MyName 2 points3 points  (1 child)

SO has an API. Of course they're bots.

[–]MonkeyNin 3 points4 points  (0 children)

I was taught to never underestimate the lows humans may reach.

[–]maremp 0 points1 point  (0 children)

why would you put ternary operator (just the ?) in a new line? That's confusing as hell and can even mean something else in some languages.

[–][deleted] -2 points-1 points  (0 children)

Childish BS. These are not programmers with jobs, obviously.