KISS Principle (Keep it Simple Stupid)
A design principle that states that most systems work best if they are kept simple rather than made complicated; therefore, simplicity should be a key goal in design, and unnecessary complexity should be avoided.
First used·1960s
Definitions·1
Synonyms·3
Category·Software Design
Also known as
Definitions
What it means.
- 01
KISS in Software Engineering
In software engineering, the KISS principle dictates that developers should strive for simplicity in their code, architecture, and design. Unnecessary complexity is the enemy, as it leads to code that is difficult to understand, maintain, and debug.
Key Concepts
- Simplicity over Complexity: Choose the simplest path that solves the problem. Don't add functionality for anticipated future needs (a violation of the YAGNI - "You Ain't Gonna Need It" - principle, which is closely related).
- Readability: Simple code is easier to read and understand for other developers (or your future self).
- Maintainability: Systems with fewer moving parts and less complexity are easier to modify and extend without introducing bugs.
- Debugging: Finding and fixing bugs is significantly faster in a simple system compared to a complex one.
Example
Consider fetching user data. A complex approach might involve a multi-layered abstraction with generic repositories, services, and controllers, even for a simple CRUD operation. A KISS approach would be to use a more direct method, perhaps a single function or class method that gets the job done without unnecessary layers, especially if the application's scale doesn't warrant that complexity.
# Complex Approach (potentially over-engineered for a simple app) class UserRepository: def get_user(self, user_id): # ... database logic ... pass class UserService: def __init__(self, user_repo): self.user_repo = user_repo def find_user(self, user_id): return self.user_repo.get_user(user_id) # KISS Approach def get_user_by_id(user_id): # ... direct database logic ... return userThe principle encourages developers to ask, "What is the simplest thing that could possibly work?"
Origin
Where it comes from.
Etymology
The acronym was coined by Kelly Johnson, a lead engineer at the Lockheed Skunk Works. The phrase "Keep it simple, stupid" is attributed to him as a design principle for the military aircraft they were building.
Historical context
The KISS principle was first noted by the U.S. Navy in 1960. Kelly Johnson, the lead engineer at the Lockheed Skunk Works (creators of the U-2 and SR-71 Blackbird spy planes, among others), is credited with coining the phrase. The story goes that Johnson handed a team of design engineers a handful of tools with the challenge that the jet aircraft they were designing must be repairable by an average mechanic in the field under combat conditions with only these tools. The acronym "KISS" was a direct result of this challenge, emphasizing that simplicity was a key design goal. The principle has since been adopted by many fields beyond engineering, including software development, business management, and even military strategy. In software, it's a core tenet of methodologies like Agile and Extreme Programming (XP), advocating for the simplest possible solution that can work.
Usage
In context.
Instead of building a complex microservices architecture for our simple blog, we decided to follow the KISS principle and start with a monolith.
My code review feedback was to refactor the function; it was too clever and violated the Keep It Simple, Stupid rule, making it hard to understand.
The new UI is much better. The designers applied the KISS principle, removing all the unnecessary clutter from the dashboard.
FAQ
Common questions.
KISS stands for 'Keep It Simple, Stupid' or variations like 'Keep It Simple and Straightforward'. It's a design principle that emphasizes simplicity over unnecessary complexity.
Taxonomy
Filed under.
Categories
Tags