Meanwhile Rust, where every control flow has a return value
it’s great, instead of ?: bullshit we just use if/else like it always should have been:
let x = if y > 3 { 7 } else { 4 };Yep
Yeah if-then expressions are really nice.
its not my fault
return apple == red ? true : falseis so cute. :3Not object oriented enough
return fruit.isColor(Color.RED)
You can have my ternary operator when you pry it from my cold, dead hands.

I kind of love the idea of the ternary operator. C is all about being a procedural language, except this is of course a lie, because it does have mathematical expressions.
But then they realized that it’s not just mathematical expressions where being purely procedural is kind of shit, so they wanted to introduce if-else expressions.
But oh no, we can’t have it look like the if-else control flow element. This is where
madnessfunctional programming lies. Let’s make it look like a mathematical expression instead, by choosing the ugliest syntax known to man.But what really makes it a meme is that other languages decided they needed to look like C, so they copied this terrible design and even though JavaScript has almost nothing to do with C anymore, webdevs in particular get to suffer from the unreadable syntax all the more.
# I mean, Crystal does have a ternary operator, too... bar = case something in "aaa" then true in "bbb" then false end foo = if bar 69 else 42 end;; Or CASE or IF or COND or whatever (let* ((bar (ecase (something) (:aaa t) (:bbb nil))) (foo (if bar 69 42))) )ternary operator rules though
Ternary operators are the one thing I really miss from Go.








