On the Joys of Programming
By: Matthew Macdonald
Tags: Software Engineering, Software Development, Careers, Programming, Productivity

The dream of becoming a programmer is alive and well. College computer science courses are struggling to meet the demand. Coding bootcamps, stuffed full of would-be career changers, are surging in popularity. Even grade school educators are teaching coding as a sort of 21ˢᵗ century literacy.

For some, the motivation is simple. It’s the dream of being paid well and getting to call the shots (maybe even wearing flip-flops to the office). That can definitely happen, and it’s no small detail. After all, any work is more rewarding when you’re respected for your skills and rewarded for your efforts.

#CoderLife

But like so many pursuits that require single-minded, self-motivated work, programming is only worthwhile if you have a spark of passion for the craft. On some level, you need to like coding — to have the drudgery interrupted by moments of satisfaction and even joy. And that also happens.

In this article I’ll share what motivated my coding sessions back in the day when I typed many more semicolons than I do now, and why the blinking cursor still calls to me from my white-on-black Material-themed VS Code window.

1. Solving the puzzle

When people used to ask me what programming was all about, I’d say something like this: “Puzzles are fun, right? What if you could solve puzzles all day long?”

For me, programming starts at the puzzle. Every code routine is an invitation to face down a mental challenge. Except this challenge isn’t a mere diversion like a Sudoku puzzle, but a real-life riddle with real-life consequences. And these puzzles are all around us. They can be challenging, like calculating real-life movement for imaginary objects. Or they can be simple, like writing the most efficient code to send periodic WhatsApp notifications to your parents. The puzzles are infinite. You will quite literally never run out of them.

Here’s another interesting thing about every programming puzzle: it doesn’t have just one answer. It’s a puzzle that you’re almost guaranteed to get right but not perfect. It’s a puzzle you can return to a week, a month, a year later, and keep polishing it into a better state. (If you like to spend hours organizing your to-do list or alphabetizing your record collection, you’ll like this part.)

There’s a balance here. Solving a new problem is joy. Improving an old solution is satisfaction. And the whole cycle — solve, test, refine — is addictive.

Of course, programming isn’t all solutions. Between the challenge and the joy is a long slog of frustration, where a lifeless piece of metal points out your every tiny syntactical slip-up. But if you’re motivated by things you know you can do — even when you can’t quite figure out how you’re going to do them — programming is the perfect perpetual challenge.

Sisyphus did not invent code, but he understood the struggle

2. The satisfaction of building something

If programming was just a series of puzzles, it wouldn’t amount to much. Eventually you’d feel like you were playing endless rounds of Freecell.

But here’s the difference. Every coding project ends by interfacing with the real world. Whatever you make has a purpose — maybe it’s just a laugh, maybe it’s just an experiment, maybe it’s just for you — but all code exists to create things that will be used.

When you build something that’s genuinely useful, you get a feeling of satisfaction. You didn’t just contribute your effort. You made a tangible product! Maybe that’s similar to the pride a carpenter feels when fitting together a new piece of custom furniture. (I don’t know — I just Ikea my way through every home decor challenge.)

Programming is also more personal than most non-coders realized. As a programmer, you probably don’t think of yourself as an artist, but somewhere in every new digital creation are your fingerprints. That makes life awkward when things go wrong, but immensely gratifying when they go right. (At least until the next refactoring.)

3. The magic button click

Developers like to say that programming is about problem solving, but we also have a secret. We are happy each and every time something comes from nothing. It’s a magic trick. It’s a new toy. You click a button, and something happens. A piece of hardware has submitted to your will, reacted to your commands. Even a “Hello, World!” program is fun. The magic is in making something happen.

Most programs are — on their own — not that dazzling. But every time you put your fingers to the keyboard, you have the ability to create something using nothing but mad skillz and imagination. And that new something can entertain, amuse, or challenge others, or just plain make their life a bit easier. That’s a super power.

See what I did there?

4. There’s always something new

In many walks of life, you can make a choice. Take the easy path, try to get as comfortable as possible, and work to keep the good times rolling. Or, you can take the steeper climb, and dedicate yourself to something that you’ll need to work at — forever.

Software development is an example of the second path. To be successful, you need to be constantly learning. I remember a year that saw three different databases APIs come through the door. All three had a different set of objects and slightly different abstractions, but they served the same basic purpose for the same underlying database. In other words, these were small changes.

Constant learning keeps life from getting stagnant. And who doesn’t want to play with the latest tech toys? Coding is like that — there are always shiny new things on the horizon. New tools, new libraries, new tricks and techniques.(This week I’m playing with Blazor, an early-stage framework for building web browser applications in WebAssembly. If it succeeds — and it’s a big “if” — the entire world of client-side development will be reinvented once again.)

But the pace of change in tech can be exhausting. Few years pass without at least one small revolution. Just at the moment where you think you’ve figured out every detail of the inner workings of the latest JavaScript framework, a tech megacompany pops out a new one. If I had a dollar for every paradigm-shifting coding library that’s dropped in my lap, I could retire and code for free.

This is also the life of a programmer — always learning and often confused, peering around in the darkness, and Googling through the late-night hours.

In coding, there is often tedium, but there is rarely boredom.

Final thoughts

No discipline is straight up joy from beginning to end, and there are plenty of things about programming that aren’t fun, from sunless days in a Aeron chair to pages of code that won’t work even though they should (or, worse, work even though they shouldn’t). But those who stick with it — those who make software coding their life — know the rewards. Because what other field invites you to imagine something new — and then design it? What else gives you the chance to create every day?