So clever that you’re an idiot

It’s sometimes said that programmers only know three numbers: zero, one and infinite.

We live in a land of edge cases and abstraction. Either something doesn’t need to exist (zero), it does exist (one), or it does exist and can have multiple values (infinite).

We love to scale things up to infinite. If two objects or concepts are similar, especially if part of the code is repeated between them, programmers will abstract the similar functionality into a third object, and then inherit that functionality back into the two original objects. Given the chance, a young programmer might try to write a function like void doEverything( Object arg1, Object arg2,………, Object argInfinite). What a beautiful design, it’s abstracted all the way out to infinite, hooray!

Obviously abstraction is great and has it’s place, but the point is that sometimes you can try to be so clever that you’re forgetting your original mission: to solve a problem for someone. I mean, if your code isn’t solving a problem why does it even exist? It’s generally considered appropriate to initially architect the system to a moderate degree of abstraction. Enough that you’re not copy and pasting code, but also not so much that you’re not able to get on with tackling the specific problem in a fairly short amount of time, rather than spending forever setting up your void doEverything() framework.

In general programmers seem to get this, the real problems occur when programming minds meet the minds of some people who think very differently to them, the users. Users don’t care about the beauty of abstraction. They don’t care that your framework means you can create new applications 32% more quickly with greater maintainability, and they especially don’t care about all the edge cases you spent so long considering and (quite brilliantly) coding graceful fall-back situations for.

The edge-cases make code more robust, but by definition most users will be focussed on the code that gets used most often, not least often. So really, most of your attention should have also gone toward making that code more useful, instead of the features and situations that will almost never get run. Yes the code needs to be there, but if it won’t be run that often, does it really need to be so shiny?

The other problem is the brilliant concepts a programmer thinks up are strange and confusing to the user. You have one name? Great, I’ll put it on the page. Oh, you can have multiple names? Oh dear, I’ll need to create a new table in the database and program in the relations. I’ll need a way for you to view your names, a list. No, because what if their names go beyond what the page can hold? Maybe a scroll panel, that should work… unless, what if their names go beyond what the scroll panel can hold? We need some sort of filtering system where they select the letter of their last name, then it filters down to a scroll panel.. that goes onto a special spreadsheet in case they want to view multiples of their last name. Now, what about first names? They might want to reuse their first name with multiple last names, so another abstraction…

Sure users with multiple last names will be happy, but how will you communicate to the user that the reason they’re jumping through so many hoops just to select their own single name is because you’ve designed it to be so scalable? And don’t most people only use one name anyway?

In reality the answer is somewhere between one and infinite. Let’s say…. ten. Or 12, or 5, it doesn’t matter. Just limit the fields to a reasonable number that will satisfy 99% of your users and be done with it, simple!

There are many other examples of when the programming mindset clashes with the person who’s just trying to get things done in Alan Cooper’s book The Inmates are Running the Asylum, a great read.

I challenge you, next time you’re designing something (code or not), ask yourself whether the quick and dirty solution will satisfy 99% of the user’ needs. Remember, as the code base grows, you can always come back later and refactor.

Comments are closed.