Always remember to KISS!

At one stage in my career, I had the good fortune to be Team Lead for a group of immensely clever developers.  Once you get over the fact that you are probably the dumbest one on the team, this is an extremely fortuitous role to find yourself in.  Each of the developers had unique traits that complemented each other well and as a team I felt we achieved a great deal. 

There were three things I noticed when leading this group of developers.

  1. Smart people enjoy being clever. 
  2. One person’s clever idea, can be another person’s good example of “how to be obtuse”.
  3. Smart people don’t always realise how much they have to dumb-down their ideas before mere mortals will “get it”. 

Now read the above three points, substituting the word “idea” for “code”… Joel Spolsky talks about how the best developers are “smart and get things done“. As a developer, I think it’s a worthy goal to aspire to.  Certainly, much better than aspiring to be “stupid and achieves nothing”.  But don’t let your ego get in the way.  If you think you are good, you’re more likely to rest on your laurels, and in this industry, you should always seek to improve.

Sometimes people’s cleverness works against them in computing.  They fail to see the obvious solution and instead invent a complex and overly elaborate approach to a problem.  Quite often, this approach would map well to how a person would best solve the given problem.  Computers are not human. A university lecturer I once had described computers as “high-speed idiots”.  When you think about it, that makes them the opposite to a clever programmer. 

So, when writing code, remember the “high speed idiot” you’re giving the instructions to.  Don’t give it a complicated set of instructions to follow, thinking that some fantastic optimisation you thought of will be the difference between success and failure – chances are, it won’t!  Instead, you’re likely to create a maintenance hell, full of little caveats that allow for edge conditions you hadn’t originally thought of.  Keep the original KISS principle in the forefront of your mind when writing code! 

There is a certain irony in this tale.  I was midway through writing this piece, when it dawned on me that one of my side-projects was an exact violation of the KISS principle.  The worst thing about it was that the program was slower than if I’d done it “the simple way”.  But on the positive side at least I proved my own cleverness – if only to myself 😉