For those of you who prefer to watch a video I made on my channel regarding this subject:
“Keep It Simple, Stupid”
well not you, you are not stupid, let me explain.
What is K.I.S.S.?
K.I.S.S. is a design principle and programming philosophy that promotes simplicity and clarity in systems and code. It suggests that systems work best when they are kept simple rather than made unnecessarily complex. Its relevance in programming lies in the fact that complex code tends to be harder to understand, debug, and maintain. As systems grow in size and complexity, adhering to the K.I.S.S. principle becomes increasingly crucial for long-term sustainability and collaboration among developers.
Why is Simplicity Important in Programming?
- Simplicity in code reduces the likelihood of introducing bugs and makes it easier to identify and fix issues.
- It creates a smoother onboarding process for new developers, as they can quickly grasp the functionality and structure of the codebase (from my experience, at my previous job, I can tell you that this one is very important).
How Can You Apply K.I.S.S. In Coding?
- Break down complex problems into smaller tasks - every function should have one job.
- The variable name should describe what it holds.
- The function name should describe what it does.
- Avoid unnecessary abstraction - if your classes or functions serve you in a specific task, don’t abstract them, and don’t add generics where they are not needed.
When K.I.S.S. Is Not Applied?
With the rise of interest in the field of AI. The best example of when K.I.S.S. is not applied would be someone who creates and trains an AI model for something a few if and else statements can do (breaking rule 4).