Programming Isn’t Hard — But It’s Frustrating

Clive Thompson on 2022-05-30

Programming Isn’t Hard — But It’s Frustrating

Developing a tolerance for deep, grinding frustration is a key part of learning to code

When I was a kid I owned a copy of Mattel Auto Race, one of the first handheld LED games. To play it, you drive a car — a bright LED blip — up the screen four times, trying to avoid other cars coming down towards you. Dreadfully simple, but in the late 70s, it was the acme of digital entertainment.

For some reason I remembered it this weekend, and on a whim Saturday night I decided to create a version of it using P5, the Javascript framework for making interactive gewgaws.

At first, things went swimmingly. I spent an hour creating the playing canvas, a class to represent the oncoming cars, and the logic to spawn and delete cars. Then I decided to make the game a bit harder by having multiple cars emerge at spaced-but-slightly-randomized times.

That’s when I ran into problems. Something was wrong with how I was managing the timing. Cars would spawn two at a time, instead of staggered. After some time messing around with a few different gambits, I couldn’t figure out what was wrong. I started getting frustrated, and pushed it aside.

That was two days ago, and I haven’t returned to it, because I’m slightly hesitant. I’m only an amateur hobbyist coder, so I frequently hit the limits of my abilities rather quickly. Whenever I’m working on a project, I always have the vague sense that damn, I might hit a snag here that I’ll never figure out. So I start avoiding the project. I don’t open it up. I don’t want to face the frustration, the sense of defeat.

Every once in a while, when someone finds out that I’m a writer who dabbles in programming, they’ll ask me: So, is programming hard?

And I usually answer the same way.

“‘Hard’ is the wrong word,” I’ll say. “It’s not so much that it’s hard.

“It’s that it’s frustrating.

The inevitable “code on screen” shot, via Pixabay

I thought of this while reading an essay in Communications of the ACM that questions the entire assumption that “programming is hard”.

As the author Brett A. Becker notes, you frequently hear — from educators, tech firms, and some software developers themselves — that coding is incredibly hard. Yet as Becker points out, there’s no strong evidence that programming is harder than other difficult activities. We don’t have any solid data showing that being good at programming is harder than being good at, say, being an ER nurse, or a trial lawyer, or a chef — in part because “hard” is a weirdly ambiguous word.

Becker suspects that coding’s reputation for requiring skull-king intelligence is equal parts narcissistic peacocking and cultural gatekeeping:

Is programming hard or not? Current evidence is not compelling nor diverse enough to answer this question in general. More defensible (and likely honest) answers are: “it depends,” and “both.” Why then, is it so common to say that it is hard? Is it often said anecdotally because there is not that much evidence to support it? Because the evidence that does exist is difficult to understand? Could it be that it is just too convenient for motivating and justifying work? Is it that many want programming to seem hard, consciously, or unconsciously? Do tech companies and hiring managers depend on the image of programming being tough and elite?

I’d agree. I interviewed over 200 programmers when I wrote my book Coders, and often they all told me the same thing:

It wasn’t that programming was particularly hard, they said. But it did require a meticulousness of thought, an Xtreme attention to detail, that was more brutal than many other disciplines.

Most of all, they noted that coding required one particular psychological disposition:

A very high tolerance for daily, grinding frustration.

That’s because most programming isn’t so much creating code as debugging it. You write a function, you test it, and — very often — it doesn’t work. You made some mistake, ranging from the trivial (a forgotten semicolon) to the more-significant (an off-by-one error). Or maybe your function interacts with a library of someone else’s code, and you don’t quite understand how that pile of software truly works. Or maybe you’re trying to work with a huge code base that legions of previous developers wrote, badly and crappily, over years, and it’s a mess of spaghetti.

Either way, a huge amount of time programmers are at the keyboard, they’re not writing fresh new code. They’re staring at code that’s full of errors, running their hands through their hair and trying to devise the next gambit that might, just possibly, get things working.

Programmers have been wrestling with frustration for as long as coding has been around. As I wrote in my book Coders

In June 1949, the computer scientist Maurice Wilkes was about to ascend the stairs when he suddenly had the epiphany that “a good part of the remainder of my life was going to be spent in finding errors in my own programs.”

What makes code frustration so particularly maddening is that you don’t know how long it’s going to last. Maybe you’ll figure out the bug in a few minutes. Maybe it’ll take an hour or two. Or maybe it’ll be weeks or months later and you still won’t have figured out the bug, so you’ll just bungee-cord it down with a nest of exception-handlers, and pray to god it doesn’t surprise you with a new one.

Either way, this is what I tell people who ask, hey, could I learn programming?

Sure, I say. Almost anyone can.

So long as you’re okay with unceasing, Sisyphean frustration.

Now obviously, programming isn’t the only frustrating activity in life! Loads of jobs are frustrating.

Working with people — in sales, in health care, in hospitality or politics — is frustrating, because people can be maddeningly complex and contradictory. Anything that involves physical dexterity and craft can be frustrating. Mastering technique in French horn or basketball can be frustrating, since you can practice something over and over and not have it yet click. I personally experience all these, because I work in a relating-to-people industry (journalism) and I’m a musician who’s often trying to grind on a new technique with guitar.

But the frustration in coding has a unique bitterness, because computers and programming languages are — in theory, anyway — deterministic. They’re clockwork mechanisms. If you can just grasp how the various parts of the program you’re writing function, you ought to be able to mentally envision the flow, and figure out what you’re doing wrong.

This is what makes the frustration of coding feel more existentially troubling, more soul-sapping, than the frustrations I feel in journalism or music. If I’m having trouble making progress on a feature article, I can console myself that “research is hard, wrangling sources is complex, writing is a messily organic process, and insight does not always arrive on demand.” The same thing goes with learning new guitar technique: One’s body, one’s proprioception, progresses in fits and starts.

But when you’re stuck on a coding problem, it feels much more like a deeply personal failure: My inability to follow a logical sequence through.

Granted, I know this isn’t necessarily the case. Coding isn’t just about raw logic. It’s an insight-based discipline, and so as with all insight-based disciplines, programming’s “aha” moments often happen in weirdly organic ways. You solve a problem by taking a break, by letting something ruminate in your backbrain, by confabbing with someone else, by rubber-ducking it. Minds are weird and nonlinear, and so coding can be weird and nonlinear.

But still, hitting a wall in coding feels like a failure of one’s pure reason. This can cause a certain grim mist of dispirit to settle upon the soul.

So: programming isn’t necessarily hard.

But it’s sure as heck frustrating.

(Enjoyed this piece? Behold the “clap” button below, and its deep secret: You can press it up to 50 times!)

(Also! I wrote a whole book about the weird psychology and mental flow of coding — buyable here in a diverse array of formats. If you’re a dev, it’s a very good gift for loved ones who have no idea what the hell it is you do all day long.)

Join Medium with my referral link - Clive Thompson As a Medium member, a portion of your membership fee goes to writers you read, and you get full access to every story…clivethompson.medium.com

Clive Thompson publishes on Medium three times a week; follow him here to get each post in your email — and if you’re not a Medium member, you can join here!

Clive is a contributing writer for the New York Times Magazine, a columnist for Wired and Smithsonian magazines, and a regular contributor to Mother Jones. He’s the author of Coders: The Making of a New Tribe and the Remaking of the World, and Smarter Than You Think: How Technology is Changing our Minds for the Better. He’s @pomeranian99 on Twitter and Instagram.