The importance of understanding what the fuck is going on
A plea to engineers
We have […] arranged things so that almost no one understands science and technology. This is a prescription for disaster. We might get away with it for a while, but sooner or later this combustible mixture of ignorance and power is going to blow up in our faces.
~ Carl Sagan
I apologise for the downbeat tone of my last post to all that came across it. As it turns out I’m human too and sometimes I have days where it feels like the world is slowly ending. This one has more spring to its step.
The other day I was reading Ian Duncan’s response to Justin Michael’s blog post and it hit me that both are talking about different things. Michael is speaking from experience and observation. Duncan, in contrast, is envisioning a world that could be; that he hopes is the one we live in; but ultimately is not real. This post is not a response to either, but I want to credit both for getting me thinking about the topics contained herein. And, for inspiring me to swear in my post title.
I have recently been blessed/cursed1 with the responsibility of being the technical lead for a large-ish project at my day job. There are nice things to say about this, although the stress of having to see one’s own ideas about how software engineering should be done put into practice is draining. It’s one thing to crow from the sidelines and quite another to be the person at which the buck stops. So far I feel happy that things are playing out broadly as I hoped, but I am not an optimist by nature, so this is not much of a reassurance.
As part of this work I’ve had the opportunity to spend time helping more junior engineers in the team develop their skills; all the way from those that are just a few years behind me in experience, to those fresh out of university. It’s quickly becoming apparent to me that the opportunity to be a part of their journey toward becoming accomplished engineers, and the chance to learn from them to improve myself, might end up being the thing I look back on as the high point of my career.
A large part of our job is the task of coming to terms with a very large codebase that pre-dates our involvement. By and large it is lacking documentation, but is nominally functional. Its complexity cuts across many lines of abstraction and its code refuses to be constrained to a single layer of the traditional software stack. I have days in which my conversations veer between topics as alien to one-another as capacitance, cache line invalidation, and JavaScript promise cancellation. It is often impenetrable, and the outputs it gives in its native environment are often perilously difficult to correlate with the inputs provided to it. Many of these challenges are inherent to the domain and are unavoidable. Some are not.
I have always maintained that the greatest skill a software engineer can have is the ability to resist sliding into mysticism, but this codebase has tested me like no other. In this god-forsaken industry with few standards, little regulation, and no social memory, it’s made me realise that the dividing line that separates mere programmers from genuine software engineers is their reaction to the unexpected.
How many times have you made a seemingly innocuous change only to see a long-standing bug vanish? How often have you tweaked a supposedly inconsequential tuning parameter only to see a system start dropping jobs at random? To a programmer, these are a sign from above: follow the hint and move on. For an engineer, they’re a clue to something deeper going on that warrants investigation.
It’s an uphill battle these days, and it seems like many have given up. ‘Give it to Claude’. If I could tell junior engineers anything, it’s to resist that siren call. Engineers are a patchwork of battle scars, and each one tells a story of a confrontation with the unexpected. Finding the solution might give you immediate joy, or it might make your boss happy, but you will learn so much more by uncovering the negative space that sits around the solution than you ever will by passing the problem on. In an age of ever-easier answers that no longer require even understanding the question, it’s critical to understand that the interests of your boss and your own career have diverged: you must fight for the space to learn.
My greatest fear is that we are creating a world that is too complex for its inhabitants to understand. That’s a problem not just for engineers, but for democracy. When a system becomes unknowable to its subjects, no matter how individually rational its constituents parts, the only means of reasoning with it is prayer. We may not be creating a god, but we’re certainly turning ourselves into worshippers. You should ask yourself whose interests this serves, and act appropriately.
Fides ex machina.
I also have the pleasure of working with a more senior engineer who’s been through it all before with a similar system. Sometimes I like to think myself an engineer, but then one of us will encounter an issue that, by all rights, seems impossible: perhaps a function being called with no caller in sight, or a machine that’s monologuing to itself instead of chatting to its neighbour. The temptation to revert the last change on a whim lingers in the air, but instead I turn to them for advice.
“Give me a moment”
5 minutes later and they’re back with an answer2.
“Those symptoms look similar to something I found 5 years ago. Back then, I spent a day walking back through the system and traced the issue to a bug in the dynamic linker. It doesn’t handle unaligned ELF segments properly: if a segment other than .text contains ARM/Thumb interworking, the linker will misalign the code and the CPU will interpret your ARM function as Thumb. By chance, part of libc, which only gets inlined with these specific set of compiler flags, looks very much like a syscall instruction after it’s been offset by a half-word, and that’s why you’re seeing a crash on a syscall ID that doesn’t exist. I found the bug in the linker and patched it back then. Here’s the diff.”
I blink. The architecture on which this bug manifests does not even support GDB. They figured this out on the back of a single, disassociated log line from the kernel among a sea of noise. I struggle to imagine how, even with a century of experience, I could reach such heights.
I try their patch. It works.
Editor’s note: Delete as appropriate.
Technical details have been obfuscated to avoid breaking NDA terms.
