Monday 26 February 2007

Software development is like ... telling a story

Went North last weekend for a fantastic baptism in Glossop. Whilst waiting to join the M6 from the M6 Toll road, had an interesting conversation with my sons (aged seven and nine). They had been listening in on some work calls regarding some NAnt scripts that were playing up, and that combined with Vista's $10 billion development cost, led them to ask (for the nth time) what, exactly, I did at work.

Whilst trying to provide an understandable explanation, it struck me that the answer given can help measure the depth of someone's development background and experience.

The answer I gave (and sub-sequent cross-examination I endured) proceeded something like this:
  • Child: So why did Vista cost so much to make?
  • Developer: Because its a very complex system, that requires lots of (expensive) people to create.
  • Child: Why is it so complex?
  • Developer: <Sigh - here we go> Well let's imagine a story. A person (called a customer), tells you a story about what they want the software to do.
  • Child: Uh-huh
  • Developer: Software developers take that story and re-write it in a language that a computer understands.
  • Child: What if the story is in French?
  • Developer: That doesn't matter - developers use a "software language", like Ruby, which the computer understands and is written in English.
  • Child: So what is a software language?
  • Developer: Its like a normal language, with two differences: firstly, the language has a very limited vocabulary; secondly, it must be used exactly - no spelling, punctuation or grammar mistakes allowed.
  • Child: So what happens if you make a mistake?
  • Developer: The computer won't understand what you've told it.
  • Child: Wow! Does that mean you have to get the story exactly correct, before the computer can read it?
  • Developer: Weeeeell.... kinda.... Its more like the computer will do something different from what we asked it.
  • Child: So why did Vista cost so much to make?
  • Developer: <Sigh - lets try a different tack> You remember the story that the developer is translating?
  • Child: Uh-huh
  • Developer: Well, although the story is simple to the customer; to the computer, its hideously complex. So complex that no single person can understand it all. Therefore the story is divided amongst lots of people, who each attempt to understand bits of it. Its about managing complexity.
  • Child: Uh-huh. Are we nearly there yet ...

Friday 23 February 2007

Principles of software development

My blog reading (Jeff Atwood, Scott hanselman) the past few weeks has turned up some excellent articles on principles of software development. For ease of reference, I've grouped them together here:
  • The DRY principle (Don't Repeat Yourself). Published originally in The Pragmatic Programmer, an abbreviated version is available in this pdf.
  • Robert Martin's SOLID principles:
  • Principles of package design - an excellent pdf that covers:
    • Principles of package cohesion:
      • Reuse-release Equivalence Principle
      • Common Reuse Principle
      • Common Closure Principle
    • Principles of package couping:
      • Acyclic Dependencies Principle
      • Stable Dependencies Principle
      • Stable Abstractions Principle
The next thing I need to mull over is how best to learn, apply and pass on these principles. Watch this space.