Ternary Operators Considered Harmful – Press Up

Conditionals are, if we’re honest, an embarrassingly large part of most programs deployed in the world. I say “embarrassingly” because a two-year-old understands conditionals, and we as developers often fancy ourselves creators of vast systems of profound, innate, and valuable complexity. Sometimes our use of conditionals is just for making a series of little form […]

In short, use it if it’s a simple conditional. But don’t do it if it’s a complex one or even nested. Agree with this.

Source: Ternary Operators Considered Harmful – Press Up

Leave a Reply

Your email address will not be published. Required fields are marked *