Infographic: on the left the arrow anti-pattern built from nested if-else blocks, on the right the same rules written as a list of early returns followed by the happy path
Aug 8, 2026 · 9 min

Clean Code: Guard Clauses and Early Return

Getting rid of the arrow anti-pattern and writing business rules as a flat flow: guard clauses, early return, and how to test them with unit tests.

Infographic: a booking request passes through the links of a chain — flight, seat availability, no-fly list, passport validity and total amount checks pass, and the chain stops at the promo code check
Aug 8, 2026 · 14 min

Chain of Responsibility: Turning Complex Rules Into a Pipeline

Splitting the seat, no-fly, passport, amount and promo checks of an airline booking into independent links of a chain, with Spring Boot.