KISS principle

Also known as: KISS · Keep it simple, stupid

On this page 7

The KISS principle, short for Keep it simple, stupid, is the design rule that a system should be built in the simplest form that satisfies its actual requirements, because every additional part, layer or abstraction adds cost and new ways to fail. In software architecture and everyday programming, KISS acts as a default bias against unnecessary complexity: it asks engineers to justify each component instead of justifying its absence.

The phrase originated in engineering practice of the mid-twentieth century, where designs had to be repairable by ordinary technicians under field conditions. Software adopted it because code is read, changed and debugged far more often than it is written, so simplicity directly lowers the long-term cost of ownership.

What simplicity means in the KISS principle

Simplicity in KISS means few moving parts and few interactions between them, not the fewest lines of code. A dense one-line expression that packs five operations together is short but hard to read, while a slightly longer function with named intermediate steps is often simpler in the sense that matters: a reader can predict its behavior without running it.

Practitioners commonly distinguish essential complexity, which comes from the problem itself, from accidental complexity, which comes from the chosen tools, structures and habits. KISS targets only the accidental kind. Tax rules, medical workflows or distributed consensus are inherently complicated, and no design rule removes that; the goal is to avoid adding avoidable complexity on top of it.

The following table separates the signals of a simple design from the signals that usually indicate accidental complexity.

AspectSimple designAccidental complexity
Control flowLinear, early returnsDeep nesting, flag variables
AbstractionsIntroduced for proven variationIntroduced for imagined variation
DependenciesStandard library firstFramework for a small task
ConfigurationSensible defaultsDozens of rarely used options
Data flowExplicit parameters and returnsHidden global or shared state
NamingDescribes intentDescribes mechanism or is generic
Signals of simple and accidentally complex code

How KISS shapes architecture decisions

At the architecture level, KISS favors the smallest number of deployable units, data stores and communication paths that can meet the required load, availability and team structure. A well-structured modular monolith with one relational database is frequently the simplest viable starting point, and splitting it into services is justified only when independent scaling, deployment or ownership becomes a measured need.

Each architectural element brings operational overhead: monitoring, versioning, network failure handling and deployment pipelines. KISS therefore treats every new queue, cache or service as a liability that must earn its place. The table below lists typical decisions and the simpler default that KISS suggests as a starting point.

DecisionSimpler defaultWhen added complexity is justified
Service boundariesModular monolithTeams or scaling needs truly diverge
Caching layerNo cache, efficient queriesMeasured latency or load problem
MessagingDirect synchronous callsWork must survive spikes or outages
Data storageOne relational databaseAccess patterns conflict fundamentally
Design patternsPlain functions and classesA pattern removes real duplication
Typical architecture choices viewed through KISS

Design patterns such as the strategy, factory or decorator pattern are valuable tools, but KISS warns against applying them before the variation they encode actually exists. A factory that only ever produces one class adds a layer of indirection without adding any capability.

KISS belongs to a family of heuristics that all aim at maintainable code, and it is often discussed together with YAGNI, the DRY principle and the SOLID principles. These principles overlap, and in some situations they pull in different directions, so experienced engineers treat them as complementary judgments rather than rigid laws.

PrincipleCore ideaRelationship to KISS
KISSPrefer the simplest workable designBaseline bias against complexity
YAGNIDo not build features before they are neededRemoves speculative scope
DRY principleKeep each piece of knowledge in one placeCan conflict when abstraction is premature
SOLID principlesGuidelines for object-oriented structureOveruse creates many tiny classes
Separation of concernsDivide code by responsibilitySupports simplicity when boundaries are clear
How KISS relates to neighboring principles

The most common tension is between KISS and DRY. Merging two similar code fragments into one shared abstraction removes duplication, but if the fragments later evolve differently, the shared function accumulates parameters and conditions. Many practitioners therefore accept a small amount of duplication until a third occurrence confirms that the abstraction is real.

Applying KISS in daily programming

Applying KISS is a continuous habit during design and code review, not a one-time decision. Useful practices include writing the straightforward solution first, measuring before optimizing, and asking in every review whether a change could achieve the same result with less structure.

  • Solve the stated problem first and generalize only after a second real use case appears.
  • Prefer explicit code over clever code, especially in shared or long-lived modules.
  • Limit function size and nesting so that each unit expresses one idea.
  • Delete dead code and unused options instead of keeping them for possible future use.
  • Choose boring, well-understood technology unless a new tool solves a measured problem.

Simplicity also has a social dimension. Code that a new team member can understand within minutes reduces onboarding time, review effort and the risk of incorrect changes. A design that only its original author can explain is complex regardless of its line count.

Limitations and common misreadings of KISS

KISS is a heuristic, and misapplying it produces its own problems. The most frequent error is treating it as permission for naive designs that ignore known requirements, such as skipping input validation, error handling or concurrency control because they look complicated.

MistakeConsequenceBetter approach
Oversimplifying the domainEdge cases surface as production bugsModel essential complexity explicitly
Equating short with simpleTerse code that is hard to readOptimize for clarity, not length
Rejecting all abstractionCopy-paste spread across modulesAbstract after repeated proven need
Ignoring nonfunctional needsSecurity or scaling gaps appear lateInclude them in the requirements
Freezing an early designSimple start becomes rigid laterRefactor as requirements change
Common mistakes when applying KISS

A further limitation is that simplicity is partly subjective and context dependent. A pattern that is simple for a team fluent in it may be opaque to another team. KISS is therefore best applied with reference to the people who will maintain the system, and the simplest design is the one the maintaining team understands best.

In everyday language

The KISS principle says: do not make things more complicated than they need to be. When people build software, it is tempting to add extra features, extra layers and clever tricks just in case they might be useful one day. Each of those extras is one more thing that can break and one more thing someone has to learn.

Think of giving directions to a friend. Saying “turn left at the bakery, then take the second right” works better than a detailed map with every side street. The simplest instructions that still get the job done are the easiest to follow and the hardest to get wrong.

Seen in the real world

A small development team at a regional logistics company was asked to build an internal tool for tracking about 2,000 deliveries per day. An early proposal included six microservices and a message broker, a separate search engine and a distributed cache, modeled on the architecture of much larger platforms.

Applying KISS, the team instead built one web application with a single PostgreSQL database, clear module boundaries and plain server-rendered pages. Load tests showed that the database handled the expected traffic with a large margin, so no cache was added. The first version shipped in about seven weeks rather than the estimated five months.

Two years later, the tool had grown to cover returns and invoicing, and only one module, report generation, was extracted into a separate background worker after it began slowing down daytime requests. The outcome was lower hosting costs, faster onboarding and fewer production incidents, with complexity added only where measurements proved it necessary.