The ternary operator has a reputation of reducing readability. However, in the right hands, it may result in less duplication.
Do you think it's use has enough of a negative impact on readability? Are there enough legitimate use cases do justify the potential misuse?
How often do you use it? Have you seen it used in contexts where it aids readability?
Do you think modern programming languages should come with it? Users of languages without the ternary operator (golang etc), do you miss it?
I feel the same as other "syntax sugar cool" things, when used correctly it improves your code, but most of the time it's going to be over used. I've seen some horrors using the ternary operator you would not believe.
what = (f() ? (g() && x ? a + d : b ) : c)
I used it when dealing with simple, 1 word condition and values.
As a Go newbie I don't miss it, having so few language constructs and operators it is very relieving, you need a condition you use
if
, simple and efficient. All your peers will do the same, everyone understands it, and it is harder to screw it up.