Software is not made with designs and ideas, but with code. Code is the raw material. Code is the only means we have to create anything. The ideas we have are only as good as the code we can write to implement them.
The following excerpt is from Richard Sennett’s The Craftsman:
“All craftsmen have material consciousness, even those who practice the most arcane art. The painter Edgar Degas is once supposed to have remarked to Stéhane Mallarmé, ‘I have a wonderful idea for a poem but I can’t seem to work it out,’ whereupon Mallarmé replied, ‘My dear Edgar, poems are not made with ideas, they are made with words.’”
So, the code is the object of all a software craftsman’s material consciousness. Material consciousness for the software craftsman becomes a fancy way to say that we are aware of the code at all times.
The code being the object of our craft is an important distinction, because it provides a rationale for never being too far from the code in our practices. The farther you are from the code itself, the farther you are from being able to produce an actual object of work.
When I learned eXtreme programming, this was taught to me in a series of practices. For example, using evolutionary design rather than designing an entire system before you write the code.
When you design something before you write the code, you add a level of removal from thinking about the code itself. You are thinking about abstractions. An alternative, evolutionary design, tells me to write a test, then do the simplest thing I can possibly do to make that test pass.
Through looking at the code, I get a feel for what the design should be. This feel lets me refactor to a better design. This design technique allows my material consciousness to not be obstructed. I get to think critically about the design of my code, but I do it in a combination of abstractions and examples, rather than just designing in the abstract.
Another example of material consciousness in crafting software is developing in vertical slices. A vertical slice is when you develop the whole set of requirements for a specific feature before moving on to another feature.
When you develop in vertical slices, you are never far from changing the code and seeing the feedback in the application. You can change some code and look at the user interface, instead of having to imagine what the front end will look like.
Or if you are coding the front end first, trying to visual what the entire API should look like. This idea resonates with the famous William Carlos Williams quote:
“There are no ideas but in things.”
It is important for me as a software craftsman to know what the material I need to be aware of is, so I don’t remove my thought too far from it. During the software craftsmanship summit in Chicago, Brian Marick said we need to treat the code as an end in itself, not just the means.
To me, this captures the idea of thinking in code.