liveBook · Manning

Simplicity

As explained in The Art of Code

Simplicity is the quality of expressing software behavior with minimal unnecessary complexity while preserving its essential structure.

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

How The Art of Code covers it

How deep it goes
Defines simplicity, measures complexity, and develops six practical levers without detailing their full implementation.
Examples
Contrasts repeated null checks with an Optional mapping chain that returns a defined fallback.
What it assumes
Assumes intermediate programming experience while teaching complexity, cognitive load, and simplification strategies from their foundations.
What you can do after
Apply it through six levers that guide refactoring, maintenance, and code review.
How it connects
Connects simplicity with complexity, clarity of intent, expressiveness, purity, readability, maintainability, sustainability, and durability.

Also explained in

Compare how 4 books explain simplicity →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Art of Code. The section links point to the parts of the book it draws on.