this post was submitted on 17 Nov 2024
140 points (94.9% liked)
Programmer Humor
32497 readers
540 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
On the left you have Elvis Presley, while on the right there's the so-called Elvis operator
why would you call it anything other than the ternary operator
Read further down on my other comment to understand, it's just how the operator looks
been programming since 2008. the fuck is an elvis operator?
Been programming since the 80s, ditto.
Ternary if?then:else
gotacha. i've only ever heard them called ternaries. maybe i'm old. maybe i'm too young. definitely one of the two
It specifically refers to this shorthand
?:
that works like this:The condition is also the value if it is truthy