Against Learned Helplessness

Everyone knows that debugging is twice as hard as writing a program in the first place. So if you’re as clever as you can be when you write it, how will you ever debug it? — Brian Kernighan, The Elements of Programming Style

I’d have to say this syntactic sugar might rot your project’s teeth. This would not make a Python: the good parts book. — boatcoder, on the for-else Python construct

Always code as if the person who ends up maintaining your code is a violent psychopath who knows where you live. — CodeForTheMaintainer on C2

There has always been a mild anti-intellectual sentiment in programming. Perhaps we all feel a bit like imposters. We feel better when we stick to the “core” of the language we use. We prefer to outsource risk to our dependencies: a library that will generate the HTML and ensure it is valid and sanitizes user text, a library that will generate the SQL for us. So much of our coding winds up being glue; we glue together our dependencies, glue our data definitions to our REST APIs. We schlep the data around without doing much to it.

Into this environment of tedium we suddenly inject AI. Now we can outsource the glue-writing itself; let the AI generate that tedious code. Some people are so happy and free now, because they really did not like writing all that tedious code. Others are upset. Some don’t write all that much tedious code; some of them are getting pressure to use AI to write it faster anyway. Some found a lot of meaning in life from writing tedious code.

The more hand-assembled your stack is, the less well AI is going to work. This is part of why a recent success story with AI came out admitting that there is no ORM. The argument is that AI is very good at writing SQL. I believe this, because SQL is old and there is a tremendous corpus of material online to learn from.

You develop skill at what you practice. Most of us have not honed our skills at using our language of choice, but rather at quickly assembling a cadre of dependencies and gluing those dependencies together. Most of us have not spent much time thinking about insourcing the responsibilities of those dependencies. We have spent a lot of time creating taxonomies and ontologies for models of our problems. We have not spent a lot of time thinking about the solutions to those problems.

Part of what is so refreshing about using an array language like APL or J is that you are forced to choose a simple encoding for your problem, and then you discover that you have a lot of tools at your disposal to solve it. You are immediately back in the business of writing code to directly solve a concrete problem. In that context, it takes almost no code; the effort is spent learning how to use the power tools, how to frame the computation so it happens all at once. And the efficiency is incredible.

Then you go back to your day job creating REST APIs for databases and doing data schlepping, and it all feels a bit tedious.

We all have these muggle tendencies. The ORM wants me to make my databases like so and my classes like so, so that’s what I’ll do. I’ll go get another library to solve this part of the problem. The AI works for me, because I went with the popular choice on everything; or, the AI doesn’t work for me because I made a weird combination of unpopular libraries, or I want to use some new thing it doesn’t have in the training set. I don’t want to think very hard about what the ORM is doing, I just want it to work. I don’t want to know how asyncio works in Python, or how HTTP works, I just want to get the job done. And you wind up with a nicely organized, orderly hierarchy of classes and modules, and it’s 150,000 lines of code, but it can’t really be less than that, and if the project fails, you can’t be blamed, because you did what you were supposed to do, just like Mark Dominus said. All of it is industry-standard, documented, of apparently high quality, unit-tested, and written for the maintainer. And yet somehow it just deeply, profoundly sucks.

I have complained in the past that there is a fundamental flaw in ORMs, and that is that the relational model is higher-level (more expressive, more powerful, more flexible) than the object-oriented model. You can’t take a declarative, set-oriented, mathematical approach to a problem and wrap it in a procedural, row-oriented language and have everything be beautiful. The relational database model is just better. But it sucks to write INSERT statements, so we use it. I’m writing a program today to try and figure out which of the three ways that seem to cause an object to get added to the session in SQL Alchemy works without producing warnings because my coworkers have used all three and I can’t tell from the documentation which ones are right and which ones are wrong but work. Is this a good tradeoff of time? Probably not, but if you’re a muggle these are your alternatives.

Perhaps we should consider another approach. Maybe we should learn our tools really well, and have fewer of them. Maybe it would be OK to insist that if your day job is Python programming, you should understand decorators and for/else and asyncio. Maybe we should not expect that you can learn a language completely in a matter of days or months, if you’re going to use it daily for decades. Maybe we should think about whether we want to take on a large dependency, or whether we can solve the problem well enough with a smaller abstraction right here. Maybe we should assume that the maintainer is as good as we are and we can hold them to a particular standard of knowledge. Maybe we should write code in such a way that we don’t feel tempted to use AI because we don’t have that much boring code to write anyway.

Maybe we should remember that we are wizards.


Date
October 3, 2025