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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s