Gardening

Today I worked a bit on the garden, that is not something I used to do much, but now we finished the move to Montreal and we’ve got a place with one so that our son can enjoy a bit of the Great Outdoors(TM), indoors.

And I was wondering how much gardening really resembles programming, the book by Steve Freeman and Nat Pryce: Growing Object-Oriented Software, Guided by Tests is spot on with it’s name.

At the beginning, nobody knows what they really want out of the garden, people kind of agree that they need a bunch of green stuff in it. So some beds are raised and seeds are sown, patches of grass are placed and some plants are pasted from other gardens.

But programming as gardening is not about just growing stuff. If you do, you end up with lots of weeds(hacks), dead branches and leafs and a bush of thorns that requires a good stretch of imagination to be called roses.

Unfortunately that is the state in which most software produced and my garden can be found, to have a garden you must do lots of trimming and cleaning(re-factoring) you have take out the dead branches and the sick plants you have to remove the hacks and cover the soil so that do not grow back.

At each trimming iteration the garden becomes less ugly until it may start becoming beautiful. If you stop trimming or take too long to trim it again it becomes a tangle again.

A good program is just like that, the best are very like bonsai, small, well trimmed and it’s growth directed according to its natural inclinations.

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