logoalt Hacker News

mjcohentoday at 1:58 AM1 replyview on HN

The ternary operator is easy to nest if you put each clause on a separate line. Then it looks just like nested if-then-else.


Replies

edoceotoday at 2:28 AM

I love the ternary operator as much as anyone. But dang if it doesn't get hard to read when there is are a few, nested even.

Does that operator compile to faster assembly that if I make the same logic with verbose `if` logic? Is that a language specific outcome?

show 1 reply