this post was submitted on 14 Jul 2023
4 points (70.0% liked)

Programmer Humor

32426 readers
668 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] kibiz0r@lemmy.world 7 points 1 year ago (1 children)

To be fair: If you are chaining ternary expressions, you deserve to suffer whatever pain the language happens to inflict upon you tenfold.

[–] Serdan@lemm.ee -1 points 1 year ago (1 children)

Why?

It's perfectly readable.

[–] lowleveldata@programming.dev 1 points 1 year ago (1 children)

It is sort of readable. A switch is "perfectly" readable for switching.

[–] Serdan@lemm.ee -1 points 1 year ago (1 children)

Ternary expressions aren't switches though

[–] Kryomaani@sopuli.xyz 1 points 1 year ago

Which is exactly why you shouldn't be using them in a situation that clearly calls for a switch.