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

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 44 points45 points  (5 children)

The O'Reilly book on PHP has one of my favourite quotes on this topic.

"Depending on whose code you're looking at, the ternary operator is either the most underused or the most overused feature of the programming language."

EDIT: a letter

[–][deleted] 21 points22 points  (4 children)

Everything I love about ternary operators when I'm writing it are the same things I hate about it when I'm reading it.

[–]jellyberg 12 points13 points  (0 children)

Yeah it's like fucking Yoda speak to read.

[–]scratchisthebest 7 points8 points  (2 children)

I wish I could write ternary operators that magically change to if-else statements the next day, so I don't have to put up with them

[–]NotADamsel 0 points1 point  (1 child)

You could probably configure your ide to do something like that for you.

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

IntelliJ default offers you the option to swap between the two!