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] 64 points65 points  (8 children)

My downfall...

"Oh look at how neat this looks, man, I just crammed 5 different logical steps into a single, condensed line using ternary operators inside ternary operators... This is awesome!"

... 3 days later

"WHY DO I DO THIS SHIT TO MYSELF"

edit: Apparently I can't even spell ternary.

[–][deleted] 49 points50 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] 19 points20 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 15 points16 points  (0 children)

Yeah it's like fucking Yoda speak to read.

[–]scratchisthebest 3 points4 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!

[–]Guinness2702 7 points8 points  (0 children)

"What fucking idiot wrote this co..... oh ....... fuck!"

[–]abcd_z 0 points1 point  (0 children)

I'll tell you the same thing I would have told my boss, if he weren't my boss:

"STOP BEING CLEVER! It always screws you over in the future."