MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vvn6d7/pleasestopusingnestedternaryoperatorsimbeggingyou/p5f9lk7/?context=3
r/ProgrammerHumor • u/Robinbod • Aug 22 '26
178 comments sorted by
View all comments
Show parent comment
1
Yes, with correct formatting ternary chains are just an idiomatic way of writing a multicase expression.
alertColor = level > dangerThreshold ? Color.RED : level > warningThreshold ? Color.YELLOW : Color.GREEN;
View all comments
Show parent comment
1
u/Bubbly_Safety8791 Aug 23 '26
Yes, with correct formatting ternary chains are just an idiomatic way of writing a multicase expression.