Friday, February 13, 2009

The First Law of Computer Programming

Recently I overheard someone complaining about their computer software. Oh wait, that was me. Why do we have so much poorly designed and implemented software?

At its most fundamental a computer, or the computer software, is nothing more than a very obedient machine. It always does exactly what it was told to do. The First Law of Computer Programming states:
A computer is only as smart as its programmer.
What many don't realize it that the First Corollary of the First Law is:
There are a lot of stupid computers.
Think about it. The basic "intelligence" of a computer is based on the skill and knowledge of the programmer. It is my contention that many programmers just don't know any better. Combine that with schedule and market pressures and it a formula for failure.

Let me give you an example. Several years ago I was coaching a team of programmers at a client site. One of the developers had been there for about 6 months. He was having problems with a troublesome piece of conditional logic. I suggested that he build a "truth table" to list out all of the permutations and expected results. "What's that?" he asked. This intelligent and articulate guy had an IT degree from a local university. He disclosed that in his entire time at college he had only had to write a total of 3 programs. Just three! None of them were in programming languages with wide commercial use.

Just what did they learn? Syntax, basic logic structures, history of computers, UML, and ... well you get the idea. Students could make a killer flowchart and entity relationship diagram, but could not decompose a problem into logical steps, or layout a usable and intuitive interface.

Years ago I was interviewing a candidate for a developer position. On his resume he listed "Familiar with the use of meaningful indentation" as one of his skills. He looked confused when I asked him about this so I requested that he tell me what that phrase meant to him. He replied, "I know how to hit the TAB key." Um, "Next!"

So what to do? I encourage all software developers to do three things:
  1. Watch people use your programs. It is amazing what you will learn about yourself and your code.
  2. Spend time working the help desk supporting code that you wrote. It will forever change how you write code.
  3. Sharpen your skills. You can never know it all and there will always be someone who knows more than you. Be humble. Learn from them. Read.
Enough said. At least for now.

1 comment:

  1. That's, COBOL, right? It's the only language i've ever had available to me that i've never written anything in. I did help someone debug some in 1980, but didn't touch it myself. And mostly, i just helped him read the manual. I've been less successful avoiding Windows.

    One of the main problems is that it's very difficult to envision how you might use something before you build it. And if you set out to build a prototype, it ends up in production. That's why building an HTML mockup, where the links go somewhere, but there's no back end, can be so successful. There's no way to put it into production, so no temptation.

    When my friend Karl was talking about his third from-scratch version of his library, i commented that "All software needs to be rewritten". I've always attributed this maxim to Karl. His first version was awesome. His second version was even better. He was a smart guy and i always valued his opinions, so if his stuff needed to be rewritten, so does everything else. It was the only conclusion one could make.

    And User Interfaces are even worse. They're complex, and people have a nagging temptation to invent unique new ways to confuse users. It's like Evolution. Most mutations lead to the death of the individual. But every now and then, an idea comes along that is actually good.


Since anyone can comment, all responses are moderated.