KISS Principal

Sun, 8 May 2011

the KISS Principal is a term used among experienced programmers that simply means, "Keep it Simple, Stupid". It could also mean, "Keep It Simple and Straightforward". Sadly, this concept is like smoke in the wind when us solo programmers who develop with only ourselves in mind.

At some point in your programming life you are probably going to have someone working on your code. Since no two people think exactly alike there will certainly be a learning curve, but it shouldn't be a terribly complex one, especially if that person knows the language.

Programmer Horse Blinders

It's scary territory to walk into a project with a custom system. If you are looking to work with someone on a custom system, the most important thing to ask is: What Pattern Does It Use? If it has no pattern, you may be in for a long, stressful job of working twice as hard to accomplish things that could be done in a much simpler way. On the other hand, you may have the potential to learn a lot, but is the frustration worth it?

Some programmers have horse blinders on, which is when they only see things being done their way. This is a huge problem, because no single person has strengths in every area. They may be great at solving complex algorithms, but terrible at keeping their code short. They may be great and making a nice working system, but it has far too many layers. A programmer set in their ways is a problem because they won't grow - but criticism can be a great tool for improvement.

Suggestions

The simplest one is, break all code down with Naming conventions, name everything with the same pattern, I personally prefer camelCase with everything. Use the same indentation and newlines for brackets {}, if your code uses it.

Follow a Design Pattern. Rather than having someone learn an unconventional way of doing things, you can have that person get familiar with a common design pattern if they aren't yet. This way explaining things will be much easier, and the way of doing things is beneficial for the future.

Draw a diagram with the stacked order of operations. If only you get it, remember you made it. If it can't be draw out in a few bubbles, it's not simple. Another person will not understand what they are doing inside your code unless its simplified.

Use a known framework. There are frameworks for every language, and they are there for a reason - to keep people within certain boundaries. Frameworks are tried and tested for reliability, why re-invent the wheel?

Write Useful Comments Often. Even with the brilliance of your naming convention, you will go back to old code and forget how something worked, it's a good idea to write comments for yourself and others.

Purpose

The purpose of keeping things simple is not to dumb down your code, it's to encourage productivity because easier to work with systems produce increased results. Ill also say, this is not an exhaustive post to discuss security.

Remember, KISS, "Keep it Simple, Stupid!" I'd assume that few programmers willingly want to work on foreign concepts that hurt them as programmers.