this post was submitted on 22 Nov 2025
651 points (98.7% liked)
Programmer Humor
27673 readers
850 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
This can also be a side product for code blocks being expressions instead of statements.
In rust for example they are, so it's not rare to see functions like:
This lets you do amazing things like:
which is the same as
x = y < 0.0 ? 0.0 : yBut is much better for more complex logic. So you can forget about chaining 3-4 ternary operations in a single line.
Lisp programmers seeing these ‘amazing things’:
But yeah, every time I'm trying to do a ternary in Lua, I miss being able to just throw in an
if. Thankfully it can be amended with Fennel.