CHILLBEARD

The "B" Log

Ramblings About Programming

Programming Like a Craftsman

I have this vision of myself. Headphones on, laser focused on the monitor, and tapping away at the keyboard. Not in the way you’d imagine a monkey bashing away until something finally works, but in the way that a calculated craftsman would: carefully making adjustments to edge closer to the perfect piece. It’s not about hacking; it’s about crafting.

Not Your Everyday Software

This is where one might launch into a rant to end all rants. A rant that criticizes the bugs, sluggishness, cruft, and bloat that cramps our style. After all, we carry super computers in our pockets but can’t get a swift response when pressing the ‘send’ button. What is it doing in the 500 milliseconds between registering the touch event and rendering a depressed button? Maybe it’s just trying to make the user depressed instead.

No, I won’t be ranting. Instead, I want to rave about what I consider to be the best way to make software. Maybe even the best way to make anything: approaching creation like a craftsman.

Get in The Right Mindset

Sit back, and enjoy the philosophical raving of a madman (that’s me) about how to make good software.

Use the tools you have, use them well, use them in ways they weren’t designed for, and when all else fails, make your own tools.

Craftsmen have dozens of tools; maybe even hundreds. Without them, the craftsman would be useless. The same goes with programmers: without compilers, debuggers, and text editors, where would we be?

Not only do we use the tools we have, we also bend them to our will. Just like a craftsmen will conjure up a jig to hold their piece in place, we’ll evoke our scripting powers to command the shell to whip up a csv file that we use as test data. You have good tools, you understand how to use your tools, and you even make up your own tools when the need arises.

To an experienced craftsmen, everything is a wedge.

Patience

Imagine you’re a blacksmith. Your newest customer just encountered the dragon tyrant over on Ghoulsbane Lane and lost his sword (and nearly his arm) in the process. It’s your job to get him back to work with some shining steel.

If you’re like me, you want to jump right in and start pounding on that metal to start forming the blade. Well, first you need to get a flame going, let it get hot, pick out the hunk of metal, heat that up, and then… you’re finally ready to strike the first blow.

After a dozen or so hammer strikes, the color of the metal starts to dull again. No more red hot steel. It’s less malleable and your arm already feels like pudding. Back into the fire. This process repeats over and over and over and over. It’ll be hours, or days, before the blade is even close to the right shape. Then you have to trudge over to the grinding stone. It’s definitely not a short process. But when you finally finish that sword…

Yes, I was stretching a bit with that scenario (and it’s a little nerdy), but this is how it goes for modern day blacksmiths as well. Go ahead and check out some blacksmithing YouTube videos (I’ve watched more than I care to admit).

Now, imagine you’re a programmer and you sit down to implement a sword in your latest game. It will go through iteration after iteration before the player ever sees the blade and once it finally gets used, there will be a bug that forces you to refactor the code again. We must be patient if we want to make software that people will actually use. Maybe even patient enough to spend a decade or more on games that never get played before we make one worth talking about.

The Details: Pay Attention to Them

Five years of my life was dedicated to the US Marine Corps. I learned a lot of things in those five years, including attention to detail. Now, I’m not saying that I miss scrubbing every inch of my barracks room, creasing my uniform to perfection, or checking the surface of my freshly shaven face for stray beard hairs, but all of that tedium taught me the importance of precision engineering.

The noble craftsmen understands this importance as well. The shine on a freshly forged hammer, the polish on a genuine leather belt, or even simply the orientation of wood grain in a basic stool. The details of a finished piece are how you can tell whether something was crafted by a master or a journeyman. Software is no different.

There is a reason Blizzard is known for its artistic polish and Tesla is known for excellence in automotive engineering. And as a developer, making the input feedback crisp or benchmarking that one rare instance when the framerate drops or just moving that UI element 2 pixels to the left will ensure that your software stands out and is something you can say that you crafted, rather than hacked together.

Quality for the Sake of Quality

This is the big one, but I find it hard to articulate. Of course, quality is important. I don’t think anyone would argue against that. But, what I mean here is that a craftsman focuses on quality because of the sense of fulfillment you get when you know you’ve made something truly good. The act of creating something that is high quality is reward enough. As a software craftsman, we should be honing our craft so that we can make good software; not to make VCs happy, gain more users, or become internet famous. There is greatness in quality for the sake of quality.

You know, even though the word ‘good’ is used a lot, it’s meaning can be so important.

I Could Go On…

But I won’t. Hopefully the point is clear.

You might have guessed that I’ve got a thing for crafting. Primarily I try to craft software, but there is something about working with your hands that is just fantastic. Maybe I’m searching for that same thing when I’m writing code. And maybe you should too.

In an effort to improve myself as a programmer, I read programming-related articles around the web. If you’d like a handful of my recommendations once a month, let me know. You can also just sign up here.

CaptainKraftComment