Why Code? | 03

Monkeys With Miniature Cymbals

Andy Warhol - Eight Elvises (1963)

03.01 repetition repetition repetition

Long before I was a weird old nerd, I was a weird young nerd. This was back in the 80s, when there was absolutely zero cool in geekdom. Our only existence in the cultural sphere was as the targets for bullies in shite US teen shows. We were taught, by our televisions, to keep a low profile and keep our smart-arsery to ourselves.

But we still experienced the natural urges of teenaged rebellion, like everyone else. Every adolescent brain passes through this stage as it matures; to test the limits of the society into which one has been plonked. In my case this manifested in the practise of going up Wolverhampton city centre on a Saturday afternoon and nobbling the display model ZX Spectrums and Commodore 64s in the windows of WHSmiths. This was how I, and my small gang of fellow troubled high-achievers, showed off to each other and stuck two fingers up to the world. It was safer than joyriding, healthier than sniffing glue and more creatively rewarding than starting fires.

WHSmiths were on the front line of a cultural wave in the 80s. When home computers were new to the market, that market needed to be told what they were and what they could be used for. This job fell to the assistants of the shops that sold the things, who tended to be woefully under-qualified for what was asked of them. The stores would all have demo machines running, often with their displays pointing outwards to the world, via the front window, to show off what they could do. And while the shop assistants may not have fully appreciated their role in the advance guard of this brave new world, the kids sure did.

This wave of computers had command line interfaces. No desktop, just a cursor innocently blinking away waiting to be told what to do. When the assistant's back was turned one of us would quickly type three lines of BASIC ("Beginner's All-purpose Symbolic Instruction Code" - the language they ran) into the closest display machine:

10 PRINT "BOLLOCKS "
20 GOTO 10
RUN

The first line prints some text to the screen. The second line instructs it to jump back to the first line. "RUN" on the third line is then the command to start the program. The resulting output - "bollocks bollocks bollocks ..." - repeats until the screen is full. Then it continues, locking the machine into an infinite loop. Many assistants wouldn't know how to break the machine out of this loop without getting their manager. You can imagine the joy.




The eagle-eyed will have noticed the space after the "bollocks" on line 10. This is the mark of the professional. Other artless amateurs (kids from other schools) might, in their haste, forget the space and fill the screen with "bollocksbollocksbollo...". This was just sloppy. You didn't get to be in our gang with that kind of attitude. Our gang was rad.

This trick, the ability to perform simple instructions over and over at inhuman speed, was our first taste of the power of these primitive machines. It's also, when all boils down, their sole ability.

Computers only have this one trick. It was their only trick back then and it's still their only trick today. All the amazing technological possibilities the information revolution has awarded us in the last half century have been built upon this one ability; to run cycles at speed. And all we call progress in recent years has been the product of those cycles getting faster and faster.

03.02 pocket calculators with delusions of grandeur

Computers are dumb. Really, really dumb. Dumber than a golden retriever. They are mere calculators, blessed with a very small subset of the skills we humans possess. They can store values, move them around in memory and perform logical operations. Every task they do can, ultimately, be broken down to these steps: storing, shifting and sums. But that's not to say this meagre skillset is insignificant. Because, unlike us, they're capable of doing these operations, with perfect accuracy, very, very quickly.

If you asked a pocket calculator to multiply two twenty digit numbers, you would rightly expect its result to be both correct and instantaneous, and think little more of it. If you asked your grandmother to do the same, and she instantly gave you a correct answer, you'd attribute her with magical powers.

It was sci-fi author Arthur C Clarke who said, back in 1968, that "any sufficiently advanced technology is indistinguishable from magic". It's an oft quoted line, because it embodies a simple truth that works in many ways. For the technologist it declares that the magic we all seek in our humdrum lives is achievable, here and now, with the tools we have at hand. For the user it is a warning that all we see as incredible, mystical even, is probably just the result of some clever maths.

The speeds at which a processor can perform this narrow sliver of human capability are bewildering. They're not just two or three times faster than us, they are billions of times faster. And this speed continues to increase exponentially, year on year. Which is why it's not unreasonable to over-imagine the possibilities of what computers can do, with their one magic trick.

For the coder - those with the skills to harness this superpower - the computer is a mathematical bicycle. Just as a bike amplifies the muscle power of feet pushing on pedals, coding is the practise of making small logical movements that can be amplified into grander outcomes. Anything that can be done once in code, can, with very little effort, be done a thousand times. Or a million. In a matter of milliseconds.

This is the concept of the "loop". One of our four basic principles of coding.



Loops are what the universe is built on. As any Buddhist will tell you, everything is cycles. It is the essence of the natural world. It's in the orbits of planets, the coming and going of the seasons, and the rise and fall of the tides.

Nothing is exempt from this natural law. Even if a stream may appear to flow in only one direction, downward toward the sea, this flow is part of a larger cycle we may not be able to appreciate. Evaporation returns water from the sea to the clouds, to the earth in rain, and back to the sea via streams and rivers. We nerds paid attention to our Geography teachers, which is how we know this.

The same applies in the human realm. Our moods and fortunes ebb and flow, much like the tides. Empires rise and fall like the seasons. All we see as permanent will, at some point, return to chaos. That's just the second law of thermodynamics, the one that insists that, sooner or later, everything turns to shit. It's all castles made of sand. Falling to the sea. Eventually.

Any system that doesn't obey a cyclical nature is usually artificial. The product of some human conceit. The march of progress is one fine example of this. The idea of financial "growth" is another. The foundational myths of most man-made organisations, ideologies or nation states, are usually built upon an antithetical expectation that they will stand forever, that they can resist the tides. That their moon will only wax, never wane.

This faith that "things can only get better", that good times await us in the future, is the very essence of Modernism. It has filled the hole left by more mystical belief systems. But modernism is a resolutely 20th Century attitude, and you don't have to go back much further to be reminded it was once more normal to look backward than forward.

Before sci-fi, we didn't look to the future for our utopias. We instead looked back to a "golden age"; an age of innocence, a Garden of Eden, an idyll we can never return to, where all was so much nicer. From the ancient Greeks, to Tudor peasants, through to Jay Gatsby and the flappers, most thought us to be either in decline, or trapped in the cycles of the past. So we beat on

If, today, we ever doubt our modernist attitude, if the nag of ancestral memory is too loud, it's easy to drown it out with a little logical squinting. Yes, this rise might be just the upswing of a cycle, but our human lives are short. When we build for grand timescales, the downswing won't come until long after we've stopped caring. Or we're dead. When our biological cycles have ceded to decomposition cycles, and our inanimate flesh can return to the earth. Downswings are a worry for humans of the future. And fuck those guys.

Is this what I was trying to express back then, in the windows of WHSmiths? A romantic critique of the new information revolution, with its inherent irony; a "bollocks" myth of linear progress, built upon a foundation of cycles. The loop I created on those ZX Spectrums was infinite. It was a cycle without an escape condition. Much like what my teenaged life in Wolverhampton felt like. Perhaps this was another layer to my artistic statement, a commentary on the economic chances of a working class youth in an ex-industrial town under Thatcherism.

Or perhaps the word "bollocks" was just funny. And it got funnier the more you repeated it. This is the magic of the loop.

03.03 the third era of visual art

So now we share a planet with these ubiquitous looping machines, capable of running calculations a gadzillion times faster than the human brain. What does this mean for our evolving human-machine symbiosis?

Most immediately it means a computer can exceed human reaction speeds. It can respond to us faster than our motor responses. Faster than raw instinct. This takes us into a whole new realm of the possible.

Any gamers reading are allowed to roll their eyes at this revelation. This is not news to them, it's the very essence of their leisure time. So I won't use video gaming to tell this story. Its history is still too short. Instead I'm gonna widen the horizon and look at the visual arts in general.

In the beginning, all visual art was static imagery. This first era of visual art began when homo-habilis started to master the use of sticks and daubs, and could then express their inner lives with lines drawn in the dirt or chalk rubbed on stone. Over a few tens of thousands of years we developed this technology, learning ever smarter ways to extract pigment from plants and the chemical mixology to get our daubs to stick to different surfaces. The static image is the oldest form of visual art and, for a long time, the only mode of visual expression we had.

The story of the first era continues into the present day. Its forms remain popular. But, alongside have grown more technologically sophisticated methods, superseding and overlapping what came before. The second era of visual art, the age of the moving image, began when the animation cycle was introduced. This era stuttered into existence through the inventive marvels of the 18th and 19th Centuries – magic lanterns, zoetropes, flip books – technologies that enabled an artist to flicker still images at a viewer faster than their eyes could process.

The limit of the human eye is, at best, fifty to sixty frames per second. This is called the flicker-fusion threshold, the point when our brains can no longer discern any difference between a continuous (i.e. real life) image, and a flickering sequence. If we had a cine-film made up of just alternating solid black and solid white frames, when played back slower than the flicker-fusion threshold the image would appear as a black and white strobe. But spooled faster than the threshold it will appear to us as solid grey - a whole new colour, one not present in the source material. Epileptics would be advised to leave the room during these experiments.

The second era was, for a while, that "sufficiently advanced technology", indistinguishable from magic. When naive cinema audiences, apocryphally, ran from an image of an approaching train. Something new had become possible with this abstraction of the static; an emergent medium, for us to explore. The magical product of a technology.

The cinema was a hugely popular art form in its first century. As was television, the next major second-era innovation, when the magic found its way into our living spaces. It's now seventy years since the rapid, widespread adoption of television, when cathode ray models, in black and white, first became affordable to the average household. Another human lifetime. Which means there are fewer and fewer people alive today able to remember a world before television. And none who will remember a time before visual art's second era.

With the moving image, the frames flashed before a viewer's eyes are fully deterministic. They have been carefully crafted in advance. The art of the second era is the sequencing of pre-defined imagery in such a way as to convey movement, flow and juxtaposition, which can then create impact and emotion in its audience.

Montage techniques, pioneered by the Russian filmmakers of the 1920s, to compress or expand time, or to create associations between images, have changed very little in a century. Edits can take full advantage of the brain's visual shortcuts, and play with its expectations. The gap created by the essential abstraction of the visual cortex's informational overload, to fit the limited bandwidth of the brain, is a magic window. This window can show us colours that aren't there. Or create emotions from the air, like ghosts from another room.



The Kuleshov Effect, where the interpretation of a facial expression is changed purely by the edit

The third era of visual art, then, takes this a step further. We now enter the age of the real time. This new form, best known from gaming, is another new medium, now with the ability to react. And react fast. A sequence of images can change, on the fly, adapted to the viewer. Still fully deterministic, but determined in the moment.

Real time imagery is a product of the loop. The machine doesn't need to know what it's going to display in advance, it's fast enough to work it out before any human eye can spot a join. This allows visuals (or audio, physics, non-player decisions, etc...) to be active, not passive. Third era media is "bi-directional", input and output in a perpetual cycle of near-instantaneous information exchange. It also no longer needs to be quite so generic; it can be fashioned specifically for an individual.

Third era imagery, unlike previous eras, is not created in the past. Artistic decisions aren't made months or years earlier. Instead they come to us from the future. It may only be a few milliseconds, not a time we could ever visit, but a future nevertheless. The viewer is still at the heart of the piece, but they're also momentarily behind it too. They're having the world, literally, drawn around them.

We are still at the beginning of this era, but we should reasonably expect it to survive at least as long as the previous two, neither of which show any signs of ever going away.

03.04 while you were busy blinking

This, then, is the magic of the loop. A robot sleight of hand, blurred faster than the eye can see. Producing colours that aren't there.

I've been using the words "magic" and "mathematics" pretty much interchangeably thus far. In the context of computers, at least, they're essentially the same thing. The magic is mathematics. The mathematics is magic. You're welcome to go back and correct all I've written above, and swap the two terms around. The meaning will remain unchanged.

That blink of an eye, the momentary future ahead of human experience, is a magic window. A mathematical window. A space only accessible to machines. The only known entities who can run the calculations fast enough.

The possibilities of this interval will stretch further, in accordance with Moore's Law. In two years time they'll be able to execute twice as many instructions within the same blink. And this will continue. More and more as the cycles get faster and faster. It's an Aleph, into which we can fit infinities.

But the trick they do, in that machine space, is merely that. A trick. An entirely deterministic sequence of logical instructions.

This mathematics allows for some great illusions - the imitation of life, the creation of worlds, the thrill of interaction. Patterns can be extrapolated. Already a machine can, literally, guess what you're about to say. And then say it, before you do. Or they can imitate the physical world, right down to the bouncing of light particles off virtual surfaces. None of it real. But convincingly lifelike.

Yet these worlds remain safe spaces. They can't escape their causal bounds. We can't be shot by a stray bullet from Call Of Duty any more than we could be hit by the train approaching La Ciotat Station. They're candy-floss confections. Their outputs evaporate instantly, like the answer to a sum.

When we see David Copperfield do his magic, when he uses some "sufficiently advanced technology" to make a plane disappear, do we ever think - shit. He'll be coming for our house next. Do we imagine a future in which an army of David Blaines will be able to do our jobs better than us, because they don't require food and water. As long as they stay sitting in that glass box.

No. Instead we appreciate the trickery. We try to see past the smoke and mirrors, expecting there to be something clever going on. Which there often is. We delight in this magic, knowing it's nothing we need worry about.

If we don't instinctively interpret stage magic as a new form of intelligence, should we apply the same to machine magic? Is this third era trickery different somehow? Or is it all just the same old bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks bollocks




next time ...

The concept of "style" in coding. Why should Claude be the only one allowed to write shite code?

>> Why Code? Pt 04: Coming soon





more words: