Simplicity keeps software understandable and maintainable as features increase. It does not remove complexity; it refines complexity into its clearest form while preserving essential structure. section 1.1.2
Readable code balances simplicity with expressiveness, clarity of intent, purity, and durability. Purity or brevity taken too far can increase complexity, so simplicity depends on judgment rather than a universal style rule. section 1.1
Making absence explicit
A chain of defensive null checks hides the intended operation behind plumbing. Mapping a possibly absent user to an address and city makes the transformation visible and supplies "Unknown" as the fallback. section 1.3 section 1.1
String city = null;
if (user != null && user.getAddress() != null
&& user.getAddress().getCity() != null) {
city = user.getAddress().getCity();
} else {
city = "Unknown";
}
Inspect the verbose conditional version, where repeated null checks obscure the business intent. section 1.1
String city = Optional.ofNullable(user)
.map(User::getAddress)
.map(Address::getCity)
.orElse("Unknown");
Compare the Optional-based version, which expresses the lookup as a direct sequence with an explicit fallback. section 1.1
Manage complexity through six practical levers:
- Prevent complexity through good team habits. section 3.2
- Organize the project so its structure supports comprehension. section 3.2
- Reduce cognitive load by simplifying code directly. section 3.2
- Hide unnecessary implementation detail from readers. section 3.2
- Investigate legacy complexity during maintenance. section 3.2
- Endure complexity that cannot be fully removed. section 3.2



