You are viewing a single thread.
View all comments
160 points

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

permalink
report
reply
-10 points

Why?

It’s perfectly readable.

permalink
report
parent
reply
0 points

There is usually a safer and more readable way to do what you want to do by chaining ternaries in most languages.

permalink
report
parent
reply
4 points

How is it unsafe?

permalink
report
parent
reply
36 points

It is sort of readable. A switch is “perfectly” readable for switching.

permalink
report
parent
reply
3 points

Match is even better, short and sweet.

permalink
report
parent
reply
-5 points

Ternary expressions aren’t switches though

permalink
report
parent
reply

Programmer Humor

!programmerhumor@lemmy.ml

Create post

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.

Community stats

  • 6.4K

    Monthly active users

  • 1.5K

    Posts

  • 35K

    Comments