Programmers as gardeners
Tags: tdd, brianeno
Published: 2017-06-27 09:40:39

---
title: Programmers as gardeners
published: true
description: A comparation between gardening and coding based on Brian Eno's ideas
tags: tdd, brian_eno
cover_image: https://cdn-images-1.medium.com/max/800/1*X817piL-wvHACAbZxmJsMA.jpeg
---
Some time ago I read an interesting article by musician [Brian Eno](https://en.wikipedia.org/wiki/Brian_Eno) titled [*“Composers as Gardeners”*](https://www.edge.org/conversation/brian_eno-composers-as-gardeners).

The basic idea of â€‹â€‹Eno is to rethink to way to compose music, going from a process in which the composer designs all the details of the piece in advance, to one in which she gives a small initial boost and let the music evolve by its own. In Eno’s own words:

>[…] I had assumed that music was produced, or created in the way that you imagine symphony composers make music, which is by having a complete idea in their head in very detail and then somehow writing out ways by which other people could reproduce that. In the same way as one imagines an architect working. You know, designing the building, in all its details, and then having that constructed. […] a new paradigm of composing. Changing the idea of the composer from somebody who stood at the top of a process and dictated precisely how it was carried out, to somebody who stood at the bottom of a process who carefully planted some rather well-selected seeds, hopefully, and watched them turn into something.


This idea stuck in my head and now that I’m practicing [Test Driven Development](https://en.wikipedia.org/wiki/Test-driven_development), it has returned to the foreground to point out to me that **this programming technique fits Eno’s philosophy**.

##Architects

When we code the unit tests after the main program (**if they are coded at all**) we are like the composer stood at the top of the process. This position forces us to have a global and precise vision of what we want to build. This idea (inherited from the infamous attempt to resemble the development of software to [other engineerings](http://blog.xebia.com/metaphors-in-software-development/)) is **unrealistic and ends up generating [convoluted, rigid and fragile systems](https://www.excella.com/insights/top-4-symptoms-of-bad-code)**.

##Gardeners

However, if we follow the TDD, we become that gardener who plants the seeds and observes the growth of them, watering or fertilizing when necessary.

We only create a class when some test asks for it (compilation error), we only codify a method when it is necessary to pass a test that had previously failed.
The production code (of which before we started we only had a general idea) **emerges test by test like the shoots of a plant**. And the design is the most natural and organic, since it has arisen from what the system demands at any moment.

Other people have found the metaphor between gardening and software development to be convenient:

* [Programming is Gardening, not Engineering](http://www.artima.com/intv/garden.html)
* [You are NOT an engineer!](http://www.chrisaitchison.com/2011/05/03/you-are-not-a-software-engineer/)
* [Software Gardening Manifesto](http://softwaregarden.io/manifesto/)

So I’m going to try to be more and more like a gardener and not an architect. As Eno himself says, they are at least **equal in dignity**.

P.S: This article has been written listening to [Discreet Music](https://www.youtube.com/watch?v=SE6nQ0lkLdY) continuously.