Simplicity and Consistency (Part 1: Simplicity)

Posted by Ken Brooks Fri, 25 Jan 2008 00:20:00 GMT

Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius—and a lot of courage—to move in the opposite direction. —Albert Einstein

This speaks volumes. The mission statement for the group I’m part of at work is ‘Simplicity, Consistency’.

Simplicity is difficult. It is probably the hardest thing to achieve in development.

A developer usually goes thru a maturity process in stages. See if any of this sounds familiar.

  • Developer produces very little code. They struggle to get anything done
  • Developer produces alot of code as they become familiar with the language of choice
  • Developer produces alot of code but now does it fast!
  • Developer produces the right solution in very little code.

Q: Why would I want to spend time simplifying if I can rip thru the code at lightspeed?

A: The code you are writing is probably going to be around alot longer than you think. That means that many people will probably have to open it up and understand it. The less lines of code you write, the less they’ll have to digest and the meaning of the code is usually not obfuscated. (Now, to be fair, I’m not saying that making code terse for the sake of being clever is a good thing. That is probably my biggest gripe with perlisms. They are terse at the expense of clear meaning.) The easier it is to understand, the faster you can change it and the likely hood that your changes will be successful will go up.

In my years of development one thing remains quite constant. It usually never fails that when a challenge is presented, the best answer invariably turns out to be the simplest. However, its usually the hardest to arrive at.

So next time someone tries to use lines of code written or some other ‘objective’ way of measuring your developer and codebase maturity perhaps you should rebut that you value those that spend more time on less lines of code than less time on more lines of code. It will save you time and money in the long run.

Tags ,  | no comments

Comments

(leave url/email »)

   Comment Markup Help Preview comment