Makiwa

Stuart Campbell’s occasional musings about software development, etc.

Strongly-typed dreams

Anyone who spends their working day programming must surely have had the experience of “dreaming in programming logic”. The forms that these dreams take will obviously vary from person to person, and from dream to dream. For me there is always an underpinning sensation that the flow of the dream is being governed by a set of rules: usually flow control logic, like for loops, while loops, switches and “if…then…else” constructs; or sometimes object-oriented tenets like inheritance, encapsulation and polymorphism. However, early this morning I had a new kind of dream - a strongly-typed dream.

Dreaming in logic sounds almost self-contradictory because dream-like thought is the very antithesis of programming logic. It is also extremely difficult to explain how a dream can be “strongly-typed” - but it all made sense when I woke up. In fact, it made so much sense that I wanted to explain it to my wife but I didn’t have time - she doesn’t know how lucky she is.

You on the other hand are not quite so lucky.

My “flow control” dreams usually involve things like flying through virtual worlds, performing loops and repeating patterns until the state of something changes; or flying through the branches of over-sized switches and logic gates. Standard stuff. My “object-oriented” dreams, on the other hand, often involve the manipulation of orbs and blocks and amorphous organic blobs - each fitting together and behaving differently according to OO rules - and I end up wrestling with issues like cohesion and coupling and exploding monkeys.

This morning’s “strongly-typed” dream was different. It was composed of separate scenes - little plays almost - and they were all playing out in the space around me. There was some story going on, although what it was escapes me now. It was probably about stabbing pancakes with coat-hangers, or something equally intellectual. Anyway, during the dream, scenes would play out in turn and then end with a result. The result could be a thought, a story plot, a thing, or perhaps an emotion. Each result made up part of the story (which was gripping!) and would be “returned” either to me or to another play. Whoever, received the result would then begin its own performance.

However, the results of these scenes would sometimes be incompatible with expected results. Each play had an unspoken expectation of what “kind” of result it needed from another play. If one expected an emotion but received a thing (perhaps a shard of petrified wood) there would be a huge problem. The performers in the wrong would have to go off and practice their play until it returned something of the correct type (in this case, say, “fear”).

So there we have it - a strongly-typed dream. Bloody tiring, I can tell you. I don’t often have programming dreams - but yesterday I was coding furiously from 7:30am to 8:30pm. So to be fair on my brain, it had little all else to work with.

You see how lucky Holly was this morning? She went to work without the glazed look you have on your face.


Categorized as Personal

Leave a Reply