DEV Community

Cover image for KISS - An old principle that everyone forgets
Dale King
Dale King

Posted on

KISS - An old principle that everyone forgets

The KISS principle has been around for a very long time (possibly since the 1930s) and is something you've heard of before. The problem is that almost no one uses it these days. I myself am a massive serial offender of early over-optimisation and it's led me to drown in my own sea of complexity as I get close to launch. It's part of a wider design framework - minimalism and we can all really learn a lot from it. For example:

Don't f**king optimise until it's necessary

What this means in practice is that you need to chose simplicity over efficiency, especially when you're prototyping. To be honest I've spent hours trying to optimise some structure or use some best-practice pattern while prototyping, and really - it probably shaved a few ms off a response time but cost me hours of dev time. Who cares, optimise later.

Minimalism as a way to know when you're finished.

A French writer Antoine de Saint-Exupéry said that

Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.'

These same words can be applied to design in the programming context. In systems design - find things that can be removed. Your database design probably has a tonne of fields that are what's known as black holes. Fields you put data into and never retrieve. Your React element probably doesn't need a little animation. You (almost never) probably don't need redux, you probably need to design your app better.

Code
Photo by Gabriel Heinzer on Unsplash

A real world example

I recently took over a project from a friend who had years of trouble with their old developers. Every time they wanted any changes done on their project, the developer would quote them some extreme price, then fail to deliver.

When I got my hands on the code I could see why. The system - while very impressive and I'm sure would have scored well on a university exam - was absolutely drowning in complexity. The old developers had used every tool in the shed in order to paint a wall (We're talking the lawn mower, the jackhammer, every power tool they could find). While they were at it they decided to re-invent every wheel... and poorly.

The first step was to remove as much complexity as possible - it involved a full database remodel, along with removal of all kinds of unnecessary front end code. The end result was a product that not only worked faster, with significantly less hosting cost but also meant that changes/features were now a 10 minute job rather than a 10 hours.

Takeaway

For the love of god please Keep It Simple Stupid. You'll thank me later. Write it on your hand or on a post-it and stick it on your screen right in the way and don't take it down until you've stopped introducing complexity

Top comments (0)