Skip to content

Make the right thing to do the easiest thing to do

June 9, 2009

This has already cropped up in slide six of my Agile Development Presentation, but it’s certainly worthy of having a post all of its own. It’s the combination of two of the most important lessons that a programmer can learn; that you should write programs for programmers, and that people are stupid and lazy. Don’t forget; programmers are people too…

Actually, I first came across this concept outside of the world of software. There’s quite a large body of work in the world of architecture and urban planning that deals with how to encourage citizens to take on desirable behaviour, and discourage undesirable behaviour. How do you have people take the stairs instead of the lift? Or take the bus instead of the car? Or walk or ride a bike? How do you encourage drivers to drive safely and respect the speed-limit? How do you encourage people to take care of their environment? To not drop litter? To not have their heating on and their windows open? I could go on… and on… but the bottom line is that if you design your building or street or public space in the right way, you can encourage people to do the right thing without them even thinking about it, because it will be the most natural and obvious thing for them to do.

Here’s a quote stolen (and butchered) from the world of architecture…

For [the required change] to occur, access to [the desirable activities] have to be convenient and enjoyable enough to make it possible for people to choose these activities instead of [doing what they do now] for their daily routines.

It’s exactly the same in the world of software development. You want to write programs for programmers because they’re the ones who need to understand what you’ve done. But people are stupid and lazy; how will they understand what I’ve done and use it correctly? How will they know which methods to call, and in which order? How will they know what to override and what to keep? In short, how can you make sure that your client will use your code to write good software?

Well, that’s quite a big question; there are quite a lot of bad things a developer can do, and therefore many ways to try and have them do the right thing instead. I’ll be covering some specifics in the near future (in fact, we’ve already started discussing one way to do it with non-default constructors) but right now I just want to add it to our ever-growing list of “how to be a good software developer”.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: