Feeling the shape of uncertainty
the role of creative expression in code based diagrams
Abstract
We often pretend that software is rational from the outset — that we arrive at solutions through clean analysis, precise method, and linear thought. But in truth, programming is messy, recursive, emotional. Understanding comes not before the work, but through it — step by step, sketch by sketch.
This article explores the idea that imprecision is not the enemy of precision, but its medium. That through expressive documentation — diagrams with rhythm, language with tone — we don’t just describe the system, we discover it. The documentation becomes a dialogue: not merely with other developers, but between the creative and rational parts of the programmer’s mind.
What follows is a working example: a diagram from the TranceSender project that began as choreography and ended as clarity. It is both an artefact and an argument — for writing software not with half a brain, but with the whole mind.
Sketching in the dark
In the fog of ambiguity
movement gifts us surety
Now that I’m retired I’m trying to write software in the way I believe it should be written.
I spent many years working in highly regulated industries under close regulatory scrutiny, where one built exactly what one said, on pain of death (no really, many of these systems were life-critical). Later, I moved into broadcast media, where so-called “agile” methods reigned. Two ends of a very strange spectrum: from a world where documentation was king (even if it led you down the wrong path) to one where documentation was loathed, avoided, and often absent — hidden behind politics and post-its.
But both had something in common: a belief that documentation was separate from code. Written at a different time, by different people, in a different voice.
Not integral to the act of programming.
That, is erroneous.
Software is a human endeavour. And the best software is written by the whole mind; creative and constructive, rational and narrative. Plenty of programmers like to call themselves “Creatives,” but rarely do working practices allow them to be creative.
I believe documentation should be the expressive partner to construction. Not a gloss, not a burden, but a co-author. Allowing the programmer to harness narrative fantasy and constructive realities in their endeavours. Otherwise, we’re only using half the brain.
If that.
These are still-developing thoughts. But what follows is one working example of what this might mean in practice: a fragment of the diagrammatic documentation from my TranceSender project.
It depicts the behaviour of simple buttons in a Graphical User Interface (GUI) application:
It certainly isn’t a picture, but neither is it a traditional technical diagram you might expect to see in any project’s documentation — it’s too colourful, and fun, for that. Almost tongue-in-cheek even.
If you can agree with me that software is narrative, then you will see why I believe it should be documented with a visual aesthetic. Not just a line diagram of connected boxes that inform — but a compositional entity that captivates and elucidates. It should contain tones, language, and spatial rhythms that reflect the choreography of the underlying instruction pipeline. Software should be felt as much as understood. Because feeling aids cognition.
“Emotion is not a luxury, it is essential to rational thinking.”
- Antonio Damasio, Descartes’ Error (1994)
When a system feels graceful — when its control flow lands like a phrase of music or steps across a dancefloor — our brains respond with focus, recognition, memory. It’s not just “understanding”, it’s knowing.
This isn’t a manifesto against detail, or a plea for decoration. It’s about crafting diagrams that reflect architectural truth. Because if you can’t draw it pretty-then maybe it isn’t pretty.
A world composed
Because I am making a music based system my flights of fantasy all revolve around music (and dance) metaphors. That’s why the staging markers in the diagram are decorated as footsteps – the metaphor is everything; it should pervade.
Here, it led me to imagine this software as an orchestral performance.
Any coherent performance arises from the interplay of specialist. Some, on-stage or front-of-house, highly visible; others very much behind the scenes, but nonetheless critical. The former allows us to experience the performance through their actions. The latter, make the performance explicable by ensuring everything happens at the right moment.
The outward expression of a shared inner rhythm. Shared through understood cues (the conductor’s baton perhaps).
Such metaphors may seem fanciful for what is mere software, especially in regards of a small and relatively inconsequential GUI application. But in fact, they are not just style, they are the architectural truth.
So I created a world in three parts:
External state (the orchestra). Buttons, Indicators, data emissions (that drive the generated sounds). These are the performers seen and heard. Their movements are real, visible. But they must follow the cue.
Internal logic (the conductor). It holds the baton, shapes the flow, grants permission, and maintains tempo. It neither flashes lights nor plays notes-but it determines when notes should arise.
The Interface (cues). Method calls and signals that allow the orchestra and the conductor to understand each other.
A GUI controller, then, becomes a performance venue with rules:
The button performs, using its own instrumentation — whether violin or variable, dainty flourish or data fragment — projecting intent through user-triggered signals and external exchanges.
The conductor delivers the score, baton poised, shaping the logic, granting permission, and keeping tempo as the internal flow unfolds
And between them, signals pass — like glances in a pit orchestra, gestures mid-phrase, nods passed in time and trust.
If we begin with this metaphor then what we build will not only work. It will resonate.
I’m sorry Juliet, but names do matter. Initially my conductors were all called ‘managers’ because you know, they manage. And there’s probably billions of ‘managers’ out there in the wilds of the world’s total codebase. Because most code is written in an office, and nobody gets paid to take the time to think of anything better. But it has become such a generic term that it has no power to engage, no real meaning. Shun such terms! Instead, create a narrative. Write a story. Every class in your architecture is a character. If you call them “Manager,” don’t be surprised when they leach the joy from your work
Creating the score
I see this piece of ‘documentation’ as being less a diagram and more a score, or visual composition. Because aesthetics matter, I started by creating a pallet, the set of colours I would use. I chose slightly muted, pastel shades because I wanted the result to be easy-on-the-eye, with nothing shouting out too loudly upstaging others. Your story, and the actors in it, might be very different – but they should influence the pallet. To further enhance the overall feel of collaboration and equal value, I also aimed for (largely) equiluminescent shades. Formal software charting tools really ought to facilitate this kind of thinking, but they don’t.
I chose an amber for synchronous flows, a red for the ‘get up and go’ asynchronous requestState signal, and a greenish-cyan for the setState signal that brings us to closure in the workflow. The red certainly stands out, and that’s where most of the action occurs, so I’m happy with that.
Perhaps not surprisingly, I chose a top down flow – very common, but you can see clearly that the overall flow is uni-directional. We skip left and right as responsibility passes between the conductor and button classes, but we always advance down the page. There are no backflows. Neither in the diagram nor in the code. Furthermore, none of the flows cross over. Believe me, the flows did cross over at times when I started, and that visual mess pointed to areas of the code that I simplified. Not just because I wanted a prettier picture, but because I ALWAYS want, simpler code.
While the box sizing is somewhat dependent on the needed contents, and clarity in the flow lines, they also represent just how much is going on within them. This means that the associated footstep markers are spaced such that they reflect the actual tempo of the software. In fact, the tempo is Quick-Quick, Slow, Slow, Quick-Quick (a kind of foxtrot) – which is honest regards how much is actually happening step to step. It isn’t just ‘what and where’ that represents the code’s behaviour, but also the relative spacing speaks to the feel of how the code progresses.
The progress indication is shown as numbered footsteps, like an old dance training chart might have done. Wholly consistent with the system’s music performance metaphor, and perhaps just a little charming – but you know, that’s allowed.
There are names of classes and methods that directly reflect the code itself. It seemed a tad over oblique not to include such, but I am cautious about encoding fine-scale code detail into the pictorial representation, as to do so just begs for things to get out-of-synch. And out-of-date documentation is perhaps worse than no documentation at all… but it’s a balancing act I guess. The picture needs to lead into the code, without being the code. Back in the day we had code generators that would turn drawn charts into lines of Ada. I think the formal method Yourdan attempted the same kind of thing. They never really took off because they were neither fish nor foul. Not exactly code but not really helpful abstractions either. I guess they were conceived when we all thought of code as being some kind of maths expression, something wholly rational – before we learnt that rational thought is aided by expressive intent. I will add, I want to rethink the names used inside the code, now that I'm becoming more convinced that the metaphor is everything.
The whole flow is annotated in plain English – in a digestible and readable tone. There’s no faux precision to it. No stiff-collared client-presentation exactitude. Formal documents often try to brow-beat the reader into submission ‘you don’t need to understand it you just need to sign the cheques; in fact it helps us if you don’t understand it’. But it’s all façade. The only true precision is in the code. The annotations should be intelligible to a child, if they are to be worth anything:
BUTTON
(wakes up in a mild panic)
OH MY GOD They pressed a button
BUTTON
Huh, really, again? Lets just ignore it, were on the case anyway
Or, CONDUCTOR chips in with:
jees man, were still busy over here with the last button pressed
Or, CONDUCTOR in a calming tone:
okaaay that’s fine let’s see what we can do about it
BUTTON
Well its gonna need more work…
CONDUCTOR
Too right, I think you’re gonna need to turn that light on…
BUTTON
Okay, I’ll give it a bash, not a literal bash, but hey PRESTO! See what I did there?
CONDUCTOR
Oh yeah, I see that, light’s on. LOVE IT
--------------------------------------------------
How many Python classes does it take to turn a light on?
2. It seems…
Okay, the characterisation here may be a little too zany for most tastes but that’s quite tweakable (as you see, in my exemplar diagram I do tone it down somewhat). But I think this style of expression, coupled with the code itself is more than adequate. More so than creating a formal specification, such as how me may render a fragment of this in Z:
SystemState
action_emitted: BOOL
ctrl_num: CTRL
display_str: STR
datum_index: INDEX
keep_lock: BOOL
HandleClick
ΔSystemState
--------------------------------------------------
action_emitted' = FALSE
keep_lock' = update(ctrl_num, display_str, datum_index)
do_clicked
Honestly, which do you prefer?
We were aways taught to think of ourselves as scientists or engineers when learning to programme. To present our case with unambiguity and great precision. And actually I was quite good at that. But then I learnt that human language is only precise when it is written, never when it is read. That’s weird. But true.
The only precise language exposition of any problem lies in the computer language in which it is encoded. Far, far better to accept that we cannot precisely describe what a computer programme does. BUT we can imprecisely describe it, employing characterisation, tone, even exaggeration to get the feel and intent across, unambiguously! Maybe it’s a paradox. We put precision in the code and expression in the documentation which between them liberates true rational thought.
Whether we happen to do that graphically, or with words, or with a mixture of the two; it is ‘the way’. This diagram isn’t trying to replace the code. It’s trying to stand beside it, point at it with a knowing smile, and say: “Here, let me show you how it feels.”
None of the foregoing attempts to prescribe a new formal method.
Even though the whitespace between components in the diagram reflect the inherent tempo of the code (by design), I really don’t think we should be buying squared-paper so we can slavishly ensure we follow that approach. In this case (where we are describing a musical system) this arrangement has a particular deep resonance which adds to the aesthetic and thus the power of the image. I did it here because it is appropriate to the problem domain (and even then, I didn’t use any kind of precise scale factor). What we really need is not more prescribed techniques, but rather the creative freedom to find aesthetic conceits that speak to our use-case. What we need, is to value the imprecision of expression.
Drawing to discover
This diagram didn’t just emerge after the system was built. It shaped the system as it was built.
Early sketches revealed a gnarl of black lines darting madly between buttons and conductors — logic routes looping back and forth as if the locking system had a mind of its own. Visually, it was noise. But that noise pointed to truth: too many responsibilities, and nowhere clear for the eye — or the logic — to rest.
In the code I thought I had done a decent job of layering the more complex buttons on top of the simpler buttons, but it wasn’t until I drew everything that I realised there was another level going on. A simpler button than even the simplest I had created – I guess like the guy who plays the triangle at the back of orchestra. Totally overlooked, but nonetheless a key player.
In response, the base classes were born: a stable home for locking, central control, and consistent flow. The derived views became lighter, cleaner — freed from clutter they were never meant to hold. From the sketch, the code was refined.
Likewise, the need for grant_workflow became clear (you see, I do need better names inside the code now) — not from debugging, but from composing. Diagramming made it obvious: we needed a beat before the melody. A preparatory gesture that would set the rhythm for all that followed. Four clicks of the drummer’s sticks.
And the “easy done” path? Purely a product of seeing the overlong loops for super simple actions charted on paper. There’s no point circling the ballroom when no one is watching.
This is what happens when aesthetic narrative isn’t an afterthought, but a companion to the work. Just as a painter discovers the form by drawing it, so a programmer discovers structure by diagramming it. Not to explain what they’ve built, but to understand what’s truly there.
The visual and the logical walk hand in hand. Each step forward in code echoes back through the drawing, and each expressive refinement in the drawing refines the code in turn. That’s not decoration — it’s dialogue.
Coda: diagram as dialogue
In the end, this diagram wasn’t just a tool for explanation. It was a conversation — between the expressive and the analytical, the intuitive and the precise. What Freud once framed as id and ego, what Kahneman calls System 1 and System 2. The two parts of self: one that needs to understand, and one that needs to feel.
And it turns out, they work best together, because understanding plus feeling equals knowing.
The diagram became not just a reflection of the code, but a reconciliation of the mind that wrote it. A place where aesthetics weren’t an afterthought, but a way of thinking. Where clarity emerged not from stripping things down, but from letting each part speak in its own voice: colour, spacing, tone, rhythm.
This is why we draw. Not just to show others what we’ve built, but to discover what we’re building. To let the work take us somewhere we didn’t expect. Because if it doesn’t surprise the maker, it won’t move the reader.
And if it moves us both — well then now we’re talking.