Journal Archives About Books Talks

Trailing Conditionals Considered Harmful Unless Used Sparingly

Thoughtful post about trailing conditionals in Ruby from Jerod and how to make code readable, scannable, and obvious.

Code is read much more often than it is written, so we need to optimize for readability over writeability. Trailing conditionals tend to do the opposite.

Reminds me of a sign I used to see in a front yard on my daily commute when I lived in the Houston area. It read: GARAGE SALE when flashing.

# Shared on