Keep it simple stupid


Share it!Tweet about this on TwitterShare on FacebookShare on Google+Share on LinkedInEmail this to someoneShare on Reddit
simplicity

Picture by Cas, on Creative Commons

Have you ever come across the KISS (keep it simple[,] stupid) design principle? It simply states that if something can be designed and created simple then it should be. Most of the systems works better if they are kept simple rather than complicated. However, sometimes it is much harder to create a simple solution instead of a complex one. How often have you implemented a feature and after that had a vague feeling that your code is too complex (and then you had spend a  significant amount of time figuring out what can be refactored to achieve a clean solution)?

Like many terms and technologies, the KISS definition was forged in the US army. More specifically, during war airplanes design and manufacturing. As the story goes, it was popularized while a team of engineers was trying to meet one of the army requirements for new planes:

jet aircraft must be repairable by an average mechanic in the field under combat conditions with only a handful of specific tools.

If it was achieved it is another story. However, it appears that currently the KISS principle is mostly used by the United States Air Force and software development industry.

Most professional programmers state that the KISS principle has an important role in the software development world. Why? It brings several major benefits to any solution:

  • easy to understand – developers not familiar with a complicated system or code fragment might spend hours or even days (I personally know examples of weeks) to understand how to implement their change or fix a bug. With proper simplicity, such time can be considerably reduced,
  • probability to introduce new bugs is smaller – everyone of us was working on some complex system. The time to introduce and release a change was running out and we were not able to fully understand the impact of our modification to the system. And even if we had enough time, we were still not sure due to its complexity. Then it appeared that we have not foreseen one rare scenario which unfortunately occurred in the production instance one week later. Simpler design and simpler code means less of such situations!
  • less documentation – simplicity makes your solution more self descriptive. It is easier to understand it at a glance and thus detailed documentation is no longer needed, both within and outside of the code. I would even recommend to get rid of documentation as much as possible,
  • developers performance – complex systems are hard to modify, especially if they contain a lot of spaghetti code. Simple solutions and designs allow you to rapidly introduce new features. By the way, it is not only complex code that blocks your developers productivity,
  • extendability – complicated solutions are usually hard to extend and/or modify. This is not only a matter of time, but also enormous amount of mental energy which has to be spent. Do you remember the days when you were trying to figure out how to integrate with a tangled client system and you felt that your brain was fried?

The KISS principle is important on all designing and programming levels. Architects and technical leaders should have it in mind while creating an overall design and defining any parts of the system. Simplicity will allow everybody to understand the concept and know the overall idea.  Clean diagrams and schemas will be readable and understandable at first glance. Whenever extending a system or implementing a new feature, they should focus really hard on maintaining simplicity. Taking compromises at this moment, while sometimes might be necessary, probably will lead to serious problems in the future. How many of you were working on a system where the modules and database schema were a total mess?

While simplicity is important for overall design, it is also crucial for a developer implementing a change. This is their responsibility that the code will be easily readable and self descriptive, that class hierarchy and dependencies will be intuitive. This is the art of programming: create clean and maintainable code! While the review process might help to detect such problems, there is often no time for major refactoring and changes.

KISS is one of the most important principles in the software development world (I just wonder for how many principles I have already stated that). Inscribe it in your head. Whenever you create some design or write a piece of code, ask yourself a question: would a random developer from my team easily understand what I want to accomplish? Is it self descriptive, clean and simple stupid?

Share it!Tweet about this on TwitterShare on FacebookShare on Google+Share on LinkedInEmail this to someoneShare on Reddit