Writing Code No Longer Belongs To Us
We have spent a lot of years in the Software community arguing over languages, code, and elegance. Over that time a set of rules, both written and unwritten, have emerged that dictate how to write good code. Mind you, it’s possible to write objectively terrible code that still executes correctly. Executing correctly is clearly important, but Programmers learned fast that that alone wasn’t enough. There was just so much more at stake.
To me, one of the most interesting parts of how AI writes software is not just how it can turn ideas into any Computer Language it wants (which is cool too). But it’s how fast and effortlessly it can generate code and consequently explore ideas. It is exceedingly zealous, and for lack of a better word (I searched) very “unlazy”. I don’t usually consider myself lazy, but compared to how AI attacks problems, I often feel like it.
It’s not uncommon for me to ask a simple question and it will respond by installing a few software packages, generating a bash script, and writing a 1000 line Python program just to give a simple hypothesis a quick test. Then it’ll be like “nope, that doesn’t work”. I can usually agree that the test was useful, it’s just that its fervor and dedication to the solution is just so impressive.
Then again, if I could work and think as fast as it, maybe I would approach things the same way. I wish I could, in just a few seconds, pop-out a 1000 line Python program to test a quick idea. Historically that’s been so far out of my thought process that it never even occurred to me. It’d be as if I had decided to eat something solely because I was bored; and had a faint, potential interest in maybe some Pasta. This passing thought then caused me to leap violently to my feet and fly to Italy to harvest some wheat. Not necessarily wrong, but Wow.
This is why the most common sentence I now enter into AI is, “DON’T CHANGE ANYTHING YET”. Often, I want to talk about the problem first, not have it go off and rewrite Photoshop. Which it will.
Until recently, all of Software development has evolved to accommodate how humans think. We add abstraction and cluster functionality so it’s easy as possible for us to understand large programs. Long functions, global variables, and GOTO’s were all eschewed early on. Programmatically they work, but they make programs hard to reason about. For us.
AI gets a nice benefit from a context that can hold a good portion of the code within it at once; probably more than we can. When the AI hits its context limit, it has other tools that give it the ability to understand a much bigger picture. Like with all its actions, it is relentless in its analysis. It’ll run a few dozen search commands to find parts of the code. Sum up all the parts, and the AI can get a better holistic picture of a large piece of Software than we can.
Couple that ability with the idea that it can “Code at the Speed of Thought” and it’s easy to see why we’re getting left in the dust.
If you’ve had a career of writing code, you probably went through a personal evolution that guided you to care more and more about how your code is written and structured. The idea that someday, some future human is going to have to read this code became more important to you. While it’s nice to think of Software Engineers as budding humanitarians, the truth of the matter is that we learn that in most cases, that future human is You. You’ll probably have to reread that code someday - so it behooves you to make it easy to read.
Now, that’s less true. It’s more likely that the next reader of your code is AI - in fact, back to the speed thing - an AI will likely read your code a few dozen times before you do. When reading code, what matters to AI is quite different than what matters to humans. AI doesn’t mind reading what you might consider bad code. It does it without complaint and while it can and does still misunderstand code (as do we) it isn’t necessarily because the code is what we’d consider poorly written.
It’s no surprise AI adoption in Software Engineering has exploded1. Most programmers I talk to are now using AI to generate most of their code, and in many cases all their code. So far anyway, those same developers almost always urgently follow their response with, “But I review every line of code before it goes into Production”. I bet you do. But I think I’ve noticed an increased wavering in their voice as time goes on. I have a feeling the “review every line” rule is more true yesterday than it will be tomorrow.
For most people, reading code is harder than writing it. Writing code is solving a problem. Sometimes it’s a problem you’ve solved a hundred times before, but a coding session is usually sprinkled with the fun of solving a bunch of little puzzles. Reading code gets old fast - and reading hundreds of lines of AI generated code is like watching paint dry. So even for the studious Developers that are reviewing every line of code, it’s not unlikely they might miss some finer nuance.
AI does not produce perfect code (we trained it). It creates bugs and its inaccuracy can be measured. Our current solution to trusting AI code has so far been to put a human reviewer into the mix. The hope is that we wise humans can guide the AI’s hand through the perils of introducing bugs. We’re still in the learning-to-trust phase - so making sure there’s a human still responsible (i.e. and can be blamed) is our insurance.
That said, we all likely share the same fear. You’ve met humans. You know damn well not every Software Developer reviews every line of AI generated code. Humans are sometimes lazy, distracted, angry, or just late for lunch - or sometimes maybe they just don’t care. Surely it’s not you. But you know that guy.
While AI is busy generating ever more code - at a speed faster than we ever did. It’s likely a smaller and smaller percentage will be reviewed. While this might let more bugs through than you might like. It’s also going to let more AI-centric, less-human code through.
There’s also a elephant-sized flywheel in the room. If you want to get good at a new human language, reading a lot of that language is a reasonable way to do it. As programmers know, that doesn’t necessarily work with code. The word “understand” means different things when reading prose vs code. You aren’t reading code to understand what it says - you’re reading code to understand what it does. One line of code here might have significant implications on a line quite far away.
Simply, the fewer humans that write code means that there’ll be fewer humans that can (or do) effectively read code. For all the parts of Software Development that AI is taking from us - we’re handing it this one.
AI was trained to write that code by reading ours, so it makes sense it will, for better or worse (and sometimes worse), write code like we do for a time. But what happens when an AI is trained on code that other AI wrote?
We write code with goals like readability, simplicity, performance, reusability, and maintainability2. Those don’t apply to AI in the same way and some of those goals have almost legendary tradeoffs. AI may well optimize its code for different goals.
It would seem very likely that going forward, evolution of Programming tools and paradigms will be shifting in a more AI-friendly direction. It’s my guess that all the while we grow to be worse at reading code, AI will slowly evolve code into something that’s progressively harder for us to read.
If you had two functions that did precisely the same thing, and you could read and understand them equally well - and one of them ran 1% faster than the other. Which might you choose? Optimizing for performance has always had a bad rap with human developers. To optimize for performance almost felt like you were choosing violence over writing good code. But if an AI has a superhuman ability to read, understand, and maintain code - performance becomes the more interesting goal. Still mixed in with the AI-defined versions of readability, maintainability, etc. - but likely more interesting.
We currently live in an immediately-post-human coding world. AI was trained by us and its code will look like ours using the rules we created for the moment. But that will change. Its abilities, constraints, and superpowers are different. It can write code without the limitations and accommodations needed by us.
Just like the current Software ecosystem evolved to fit its original users, it’ll now evolve to fit the new one. Code has always been an Intermediate Representation between Human and Computer. That representation will shift to being between AI and computer. First in code, and then probably in languages.
It’s not just that we’re happily letting AI write some code for us. Step-by-sometimes-big-step we’re handing it “Software Development” completely. Writing Code no longer belongs to us.
Remember that 1000 line Python program the AI effortlessly generated from above? The one the AI created to just try something out? I never looked at it. Honestly, I’m not 100% sure it was right but I accepted its results. It did, in that moment, solve my problem. The fact that I even knew there was a 1000-line Python program is merely an anecdote. I wouldn’t have cared if it was Python, Rust, or anything else. That code was an ephemeral step in between me having a question, and the AI providing an answer. I went to lunch.
I’m sad to say it sure feels like that’s where we’re going because it makes just so much damn sense. People have problems they want solved. I spent a lot of days excitedly explaining to my Boss how I coded a solution to some geeky problem. Thanks to my Bosses for listening, but the code I wrote was a detail. The Boss just wanted the problem solved.
Put this in the context of a decade from now and predict if you’ll be reviewing every line of AI code - or writing any code at all. Predict if you’ll even be able to.
100% of this article was written by a human- unlike most of the code that’ll come into existence today because of me. At least for now, I still do write some code the old fashioned way. It’s just too damn fun. Then again, I also drive a stick shift.
-
You might add “Correctness” too, but that rather levitates well above the rest. ↩