I think the ternary operator actually encourages readability.
In my experience, the only time ternary syntax reduces readability is if you have too much logic jammed inside a conditional. And if that's the case, the normal if / else syntax wouldn't make things much clearer.
In other words, the ternary operator just "amplifies" how (un)readable the conditional logic is to begin with. Does that make sense?
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I think the ternary operator actually encourages readability.
In my experience, the only time ternary syntax reduces readability is if you have too much logic jammed inside a conditional. And if that's the case, the normal if / else syntax wouldn't make things much clearer.
In other words, the ternary operator just "amplifies" how (un)readable the conditional logic is to begin with. Does that make sense?