335
and people wonder why we say PHP is a meme
(lemmy.world)
Post funny things about programming here! (Or just rant about your favourite programming language.)
I agree you should use a switch where applicable, but ternaries are the expression equivalent of if-else statements. If I have two conditions and a default, and each branch simply evaluates to a value of the same type, I'll probably just use a ternary.