SHR's Occasional Braindump

Crafting Code and Business in a Beautiful Place

Sucking Stones: The Programmer Psyche in Beckett

This is a writeup of a talk I gave at Barcamp 5 Chiang Mai on June 30, 2012. I’ve fleshed out a few of the ideas more here than I was able to do on my feet. And I may add new material over time – for the more I think about this, the more I find. Slides are also online.

One of the delights of being part of the tech community is hanging out with people who have such varied interests and passions, and who can talk about them in depth and with reasoned conviction. So the shallowness of the geek and hacker stereotypes held by those outside the community is easy to identify as such and dismiss.

That said, there are certain character traits that crop up time and again in such circles. The passion of the geek often rests on something akin to obsession and manifests as a certain compulsion. The programmer with a project or problem on his or her mind will often drift between the here and now and what seems like another plane, no doubt the mental space which the project occupies. And then there’s absent-mindedness. I’m sure many of us, in our more reflective moments, may even notice such things in ourselves.

It doesn’t take much insight to realise that these characteristics are not caused by the act of building software. But rather that programming and software development tend to have an appeal to people of a certain mindset and disposition. Academics study such things.

It’s also true, though, that programming as an activity or profession practised by many is a relatively recent phenomenon. Yet it seems unlikely that the idiosyncrasies and traits which characterise programmers today have only come into existence since the 1950s and 60s.

This raises the question of what the geeks were up to before the invention of modern-day computers? Literature has some answers.

Samuel Beckett, 1906-1989

To my mind one of the greatest documenters of pre-computer-era geeks is Samuel Beckett. An Irish writer who wrote in English and French, he won the Nobel Prize for Literature in 1969 (“for his writing, which – in new forms for the novel and drama – in the destitution of modern man acquires its elevation”). He’s one of my favourite writers of the 20th century, and I’m pleased to have this opportunity to introduce some of his work in this slightly unorthodox reading. I feel it shines a light on us, as programmers, today.

Murphy (1938)

Beckett’s first novel to meet with critical acclaim was Murphy. Published in 1938, it begins like this:

The sun shone, having no alternative, on the nothing new. Murphy sat out of it

Look at that. Something big, inevitable – therefore inherently uninteresting – going on, and our geek hero has placed himself outside of its influence. This is the nerd in his (dark) basement (or garrett in this case), the Open Source coder avoiding the Borg/SunOracle.

As we read on, we learn that Murphy is not only in the shade, he’s also naked, strapped into his rocking chair.

Seven scarves held him in position. Two fastened his shins to the rockers, one his thighs to the seat, two his breast and belly to the back, one his wrists to the strut behind.

If the opening sentence presented an image of detachment, here is its opposite, attachment, both physical and emotional. For this is “his rocking chair”—not “a” rocking chair—it is made “of undressed teak, guaranteed not to crack, warp, shrink, corrode, or creak at night. It was his own, it never left him.” Like a laptop to a geek, so is this rocking chair to Murphy.

And soon we have an explanation as to why this rocking chair is so dear to him.

He sat in his chair in this way because it gave him pleasure! First it gave his body pleasure, it appeased his body. Then it set him free in his mind. For it was not until his body was appeased that he could come alive in his mind, as described in section six.

The rocking chair, then, is a tool. It’s Murphy’s portal to the world of the mind. There’s even a man page reference to how that works (which the novel does indeed fulfill in chapter 6). And, we’re told, that alternative mental space is a good place:

And life in his mind gave him pleasure, such pleasure that pleasure was not the word.

This is a place that we, as programmers, can recognize. Right from the outset, Beckett is dealing with characters that resonated with me from the first reading. Even if, at that time, I couldn’t quite identify why.

Sucking Stones—An Algorithmic Meditation in 1800 words

In the early 1950s Beckett published a trilogy of novels in which he continues his studies of outsiders. The first of these, Molloy consists of two interior monologues. The first voice is that of a man living in his mother’s room. He describes an earlier journey to find his mother, which is how he came to be where he now is. Plot really isn’t the focus from here on out, though, in Beckett’s work.

At one point in Molloy’s journey he was by the sea and “took advantage of being at the seaside to lay in a store of sucking-stones”. A slightly abridged version of this part of the novel is available online – please enjoy it now.

Any programmer will immediately recognise what is going on here. In his search for the ultimate sucking-stone management system, Molloy follows a familiar path as the problem at hand takes a grip on him. His initial pass at a solution is quickly rejected as unfitting to a man of his calibre:

But this was only a makeshift that could not long content a man like me. So I began to look for something else

As he gets drawn deeper into the search for a solution, there is a period where he is reeling in complexity, and losing his bearings:

For I was beginning to lose all sense of measure, after all this wrestling and wrangling

This leads to frustration, and temporary withdrawal: “I gazed at them in anger and perplexity”. And the problem is cast aside for some time. As we all know, that’s when the magic starts to happen. Then:

One day suddenly it dawned on me, dimly, that I might perhaps achieve my purpose without increasing the number of my pockets, or reducing the
number of my stones, but simply by sacrificing the principle of trim.

Here is the ah-ha moment, when our thinker sees that the solution lies not in tweaking the parameters he has worked with to date, but by changing tack and compromising on a principle which had been, until now, taken for granted. In a classic moment of pride mixed with self-doubt and faux-modesty, Molloy wraps his reveal in a disclaimer, lest any other stone-sucker immediately leap on his solution and tear it apart:

Now I am willing to believe, indeed I firmly believe, that other solutions to this problem might have been found and indeed may still be found, no less sound, but much more elegant than the one I shall now describe, if I can. And I believe too that had I been a little more insistent, a little more resistant, I could have found them myself. But I was tired, but I was tired […] But not to go over all the heartbreaking stages through which I passed before I came to it, here it is in all its hideousness.

And, finally, Molloy explains the algorithm he arrived at. Or, almost finally. For even having explained it, he cannot help but dig into its weaknesses, and probe deeper for better solutions. At one point he even considers, momentarily, a more enterprisey solution:

For [it would not have been] enough to number the stones, but I would have had to remember, every time I put a stone in my mouth, the number I needed and look for it in my pocket. Which would have put me off stone for ever, in a very short time. For I would never have been sure of not making a mistake, unless of course I had kept a kind of register, in which to tick off the stones one by one, as I sucked them.

It turns out that the main weakness of the chosen algorithm relates directly to the abandonment of the principle of trim which had, of course, been the key insight in its discovery. And Molloy astutely recognises that what he’s up against is conflicting requirements: “Here then were two incompatible bodily needs, at loggerheads.” His solution was a trade-off, a fact which he only recognised during run-time (or, I suppose, suck-time).

Finally, though, this has been a mere mental exercise, maybe even a code kata if we see it in a positive light:

And the solution to which I rallied in the end was to throw away all the stones but one, which I kept now in one pocket, now in another, and which of course I soon lost, or threw away, or gave away, or swallowed

Or perhaps Molloy was so transfixed by the initial shape of the problem that he failed to see the best solution, which appears only with the removal of incidental complexity.

Waiting for Godot (1949)

In the passage from Molloy Beckett describes the workings of the inner geek as his mind moves through a problem. By contrast, in Waiting for Godot Beckett shows us what happens when two of these characters interact. Gone is the inner monologue, now we have dialogue:

@vladimir Joined channel #waiting-for-godot
@estragon Joined channel #waiting-for-godot
<vladimir> And yet … (pause)… how is it—this is not boring you I hope—how is it that of the four Evangelists only one speaks of a thief being saved. The four of them were there—or thereabouts—and only one speaks of a thief being saved. (Pause.) Come on, Gogo, return the ball, can’t you, once in a way?
<estragon> (with exaggerated enthusiasm) I find this really most extraordinarily interesting.
<vladimir> One out of four. Of the other three, two don’t mention any thieves at all and the third says that both of them abused him.
<estragon> Who?
<vladimir> What?
<estragon> What’s all this about? Abused who?
<vladimir> The Saviour.
<estragon> Why?
<vladimir> Because he wouldn’t save them.
<estragon> From hell?
<vladimir> Imbecile! From death.
<estragon> I thought you said hell.
<vladimir> From death, from death.

Vladimir brings up a new topic and tries to get Estragon involved in dicussion. The topic is the inconsistencies in the way the four Gospels report the final end of the thieves crucified alongside Jesus. Like a devloper trying to create a spec from conflicting and incomplete customer inputs, Vladimir is driven to find truth where none can be found. He engages Estragon in the quest (or the game), though Estragon’s mind is elsewhere (likely a ditch). He tries to play along, though, eventually getting dragged in, if never mustering the level of excitement of his peer:

<estragon> Well what of it?
<vladimir> Then the two of them must have been damned.
<estragon> And why not?
<vladimir> But one of the four says that one of the two was saved.
<estragon> Well? They don’t agree and that’s all there is to it.
<vladimir> But all four were there. And only one speaks of a thief being saved. Why believe him rather than the others?
<estragon> Who believes him?
<vladimir> Everybody. It’s the only version they know.
<estragon> People are bloody ignorant apes.

Vladimir won’t let it go—despite, I think, sensing that there will be no resolution. He’s now in it for the argument itself. Estragon finally falls back on one of the classic argument-ending tropes, that users are stupid.

Do Not Presume

Years later in an interview, Beckett posited a different lesson from the case of the two thieves, borrowing from Saint Augustine:

I am interested in the shape of ideas even if I do not believe them. There is a wonderful sentence in Augustine. I wish I could remember the Latin. It is even finer in Latin than in English:
       “Do not despair; one of the thieves was saved.
        Do not presume; one of the thieves was damned.”
That sentence has a wonderful shape. It is the shape that matters.

This resonates with me as a programmer. Beckett here is admiring the form of the expression and the idea, in isolation from its content. Satisfying code often has a similar attraction, and uses similar devices. In fact, that paraphrase of Augustine almost has the look of code. Of course the risk is that we miss the message while being sucked in by the elegance of the form.

Beckett’s work makes heavy use of structural formalities, such as repetition, variation, echoes and parallels. But where literature can achieve interesting effects, even greatness, by playing with the interaction between form and meaning, I think great code tends to have the closest correspondence between form and function. Is this one of the distinctions between art on the one hand, and craft on the other?

Bleak Outlook

Godot ends with a bleak metaphor:

Astride of a grave and a difficult birth. Down in the hole, lingeringly, the grave-digger puts on the forceps. We have time to grow old. The air is full of our cries. But habit is a great deadener.

Never has there been a clearer description of consulting. From beginning to end is nothing but pain, the only consolation being that our senses grow dull with repetition and time.

This may all seem a little dark. But if there is a serious point here it’s this: Beckett got closer than most writers to anatomizing the raw human psyche. As programmers, we spend a great deal of time living in the depths of our own minds; we regularly come up against our own psyches as part of the creative endeavour. We need to be ready to deal with this. Literature can be a tool to help us break out of the bleak cycle.

Coda: A Happier Rereading?

The English playwright Tom Stoppard ended Jumpers, his 1972 play about academic philosophy and the perils of relativism, with this (relativist) rereading of Beckett:

Do not despair—many are happy much of the time; more eat than starve, more are healthy than sick, more curable than dying; not so many dying as dead; and one of the thieves was saved… No laughter is sad and many tears are joyful. At the graveside the undertaker doffs his top hat and impregnates the prettiest mourner. Wham, bam thank you Sam.

Clearly this is pastiche. But for a while it holds some allure as one way of dealing with the difficulties of creativity. Unfortunately it is, in the end, little more than an exhortation to put a happy face on everything. Believe in the best, and all may be good.

And for most geeks, too, this isn’t a satisfying answer. Stoppard, in parodying academia, comes close to describing the shallow approaches of self-help authors and corporate trainers. To people facing the challenges of real creative work on a daily basis, and taking their work seriously, this offers little help and a good measure of annoyance.

Let Us Do Something

So, we’ll turn over the stage for the final words to Vladimir. For a moment, let us forget the dramatic irony of this speech and take it at face value. It offers a message that can guide us on our path as we code and create. This is, indeed, a special moment in time.

Let us not waste our time in idle discourse! Let us do something, while we have the chance! It is not every day that we are needed. But at this place, at this moment of time, all mankind is us, whether we like it or not. Let us make the most of it, before it is too late!

For Sebastian. Thanks for your encouragement

blog comments powered by Disqus