On writing artisanal code

Every artisan at a certain point in time just stops and starts thinking about the inner-workings of his craft. He ponders on the whole process from an Outside while trying to make connections between apparently dissimilar entities that his craft is made of.

One might argue that this is a purely subjective endeavor: well, without any formal applicable theories it certainly is ! yet this doesn’t mean it cannot spark insights.

Coding is a very elusive mixture, it involves formal rules (the language), it can be mixed or even expressed via mathematical modeling and it’s also a first-class subjective practice. Coding is thus artisanal because we have the metaphor of shaping an abstracted real-world idea into another realm.

Code is ephemeral, it is driven by a set of semantics that must be transmitted. We can see it as a machine, yet one that must be plugged into another machine: the artisan himself, together they create meaning.

The issue with this is that meaning is hardly quantifiable: it depends on a transient object -> the mind that interprets it thus code is an incomplete little machine.

The question rises: what characteristics of code have enough in common with all minds that can form plateaus of recognizable values ? Well, if code conveys meaning, we want code that is expressive so that is able to convey its creator semantics to any reader or to put it another way : we want to maximize the function of adherent readers.

OK, what makes code expressive ? Looking at its form we can have code that is verbose versus code that is succinct. How do we choose which one is better ? We might say that it depends on the code but think about this: let’s say we have two versions of the same implementation of a solution to a problem, now: giving that they have the same quotient of conveying meaning which one we choose ? The answer is clear: the succinct code but only when the quotient approaches the idealized value of one.

How we maximize this quotient of conveying meaning ? I’ll ponder some more on this.

“It helps to have a language that is like molding clay rather than carving stone.” - Paul Graham

Tagged under: