DEV Community

Discussion on: Why doesn't Go have Ternary?

Collapse
 
joelbonetr profile image
JoelBonetR 🥇

A ternary is just syntactic sugar for an if-else statement, it does not objectively provide any other benefit, hence it does make sense to have it very very low prioritized in the road map.

By the way in the disadvantages list I'd add that it does not work well with doing a single thing in a condition (no else) even though some people uses ternaries that way (for any reason I can't comprehend).