‘Iacta alea est’

Age of Elmpires

Penned on 15th January 2016

I’ll never forget the evenings after my older brother returned from his exchange trip to Germany as a young teenager. He didn’t come back talking about Bratwurst or Bier but instead regaled us with vivid descriptions of a new computer game he had played: Age of Empires. We were so intrigued we began the long and arduous campaign of first seeding our parent’s mind and then engaging on an extended charm offensive in order to secure it. And it wasn’t so long that our interest had waned. (That game also led to picking up a pair of network cards and an RJ45 Cat 5e crossover from the resident school computer geek, which was in some ways the beginning of all this programming malarkey, but I digress.)

Age of Empires, like most similar games at the time (Command & Conquer, Commandos: Behind Enemy Lines) had a map that was shrouded in black mist or fog. You stood in a corner, and your visibility was limited to the range of your character. The great strategy argument was whether or not you should immediately set up shop where you were or go exploring to find a better place. What if there were a crop of berries around the corner? The trade-off was, your enemies might be advancing at a faster rate if you spent time scouting, potentially overwhelming you before you had a chance to establish yourself. Hmm, wouldn’t it be a good idea to locate your enemies and keep an eye on them, or at least know where they are? I liked to scour the board, taking the risk to find the perfect spot, rich in resources and defensible in case of attack. Success was eliminating the fog of war and reaching the boundaries of the map.

This isn’t too different to my approach when learning languages or frameworks, and is borne out of experience. When I learned Ruby on Rails I didn’t know Ruby and I didn’t know Rails, or even web development, either. I did a little bit of scouting, enough to think Rails was the right choice (it was) but I didn’t go much further, only learning what I needed to build stuff, which was fine—it worked for me. However, I was always coming across things that were better ways of doing what I had done and wondered how people had arrived at those better solutions.

Later, when I delivered a few workshops, teaching Ruby and Rails, I did a lot of preparation work to ensure I knew my stuff. Of course by this point I had realised that much of the improvements were simply the application of the Ruby standard library to the Rails problem, and making sure the wheel was not reinvented. By studying up on the standard library and Rails documentation I was lifting the fog of war, and realised just how much of a benefit that knowledge would have been at earlier points in my career, and how it would have saved me significant time and effort to make the up front investment.

An interesting observation I also made was that eighty percent of the time we only need to (or just) use twenty percent of the standard library or Rails framework. I resolved at that point that if I ever had to pick up a new language or framework then that is what I would try to do.

Now JavaScript kind of crept up on me. Its utility and versatility meansthat you are committed to using it before you’ve had the chance to make a decision. As you surveyed the foreboding landscape, jQuery came up and gave you a friendly hug, promising you that it would be okay. You had no reason to disbelieve her and apart from a few minor arguments, things worked out great; she was always very devoted, calling you when the document was ready, and always giving of her self. At the same time you felt restricted. Like there was a world out there that you weren’t getting to see, because you were committed to jQuery. One day you decided to take the jump into the unknown. The wanderlust had got the better of you. YOu felt that there was so much more to JavaScript than just jQuery. You felt empowered initially, but the fight demanded more of you than you had. You picked up a backbone, looked for a batman, though that you could, yes, I can JS. But JavaScript was so Angular, hard as mithril, it was impossible to redux because it was always changing, having to react to something always in flux.

There’s a reason that someone wrote, not just one book, but a series of books, called “You don’t know JS”. Almost trying to rub it in. ‘Learning’ JavaScript is a sisyphean task and leaving it is not an option.

April was the cruellest month, but now they are all as equally cruel in this wasteland. And you don’t even know the worst of it because the fog of war seems to retreat further than where you started from. Enclosing. Encroaching. Enough. ENOUGH.

JavaScript does enough to leave you in a cold sweat after a post-apocalyptic nightmare. The truth is, once you know the language, it has such wide semantics that it births just as many idioms as there are applications written in it. As many styles as there are programmers that write it. There’s a reason it is called an assembly language for the web, and although we rejoice at that concept, we forget, or never knew, what a mess it was to program at such a low level. And impossible to hold in your head, or at least, impractical.

All that is to say, I didn’t stick to my guns with JavaScript. And although I attempted, many times, to lift the fog of war, the map just kept expanding and by the time I got back to where I started, the fog was back.

So when you hear of something that manages to express the dominant application architecture popularised by React, Virtual DOM, Flux, Redux, the single state atom as the outcome of reduced activity used to statelessly render an HTML and CSS user interface more simply and more concisely, then your ears prick up and your senses become attuned and attentive to what comes next.

And then you see it, a tree arising out of the wasteland, as living and green as the wasteland is dead and gray. How can this grow, here? Puzzling for a moment you realise its roots must go much deeper than what you see on this barren surface and you walk slowly and tentatively towards it. As it looms larger you begin to up pace. As you sense its vitality and even a hint of its welcome you run faster as everything around you blurs out of vision, until you meet it with outstretched arms, throwing yourself into its branches, wrapping your arms around its trunk, nestled, lost, safe, in Elm’s warm embrace.

Sunday 10th January 2021.