Tuesday, February 15, 2011

We are all Gardeners and Authors

In the previous book on Software Engineering that I read the work of designing and developing software systems was characterised as gardening. The authors talked about the ever ongoing effort of sustaining and improving the internal quality of the code in terms of nurturing, guiding and pruning. I kind of liked that picture of the system under development as something fragile and tender that we should lovingly care about to make sure it will grow into something really valuable for the business we set out to serve.

In terms of software development this work of a gardener's can be translated into finding the proper input of both domain knowledge and reusable pieces of existing code (nurturing), applying a sound architecture to shape the system form (guiding) and constantly refactor to improve existing code and get rid of what is not serving its purpose any more (pruning). At our disposal we have tools like Domain Driven Design (DDD), Test Driven Development (TDD), different levels of software patterns and a powerful IDE. Growing a system is also a great metaphor in these times of agility. Doing the agile development right we will continuously add small pieces of new functionality to a working system always being careful not to wreck the tender "plant" we are growing. In other words - we should all be Gardeners.

We should also be Authors. In the current book I'm reading, "Clean Code" by Robert C Martin, "Uncle Bob" argues that good source code should be just like prose. It should be easy and enjoyable to read as well as informative and clear about its intentions. After all the code we write will be read by ourselves and others many, many, many times in the future. Writing  code that can be correctly and efficiently executed by a computer is not that hard. In most cases the compiler and run-time optimizer will take care and by adding some tests to the mix we should not get that many surprises. The really hard part is to write code that can correctly and efficiently be read, understood and changed by humans. So, next time you sit down to do some programming, try to think of yourself not as someone talking to the computer but as an Author talking to your fellow and future developers with the source code as your means of communication.

No comments:

Post a Comment