You may not know this about me, but I’m a programmer. It took him years, but one of my best friends from college finally convinced me to try my hand at it…well, a decade ago, now.

He found the right language for me (Python), and then my interest in tedious videogames sealed the deal. Most of the hours I’ve spent programming have gone toward automating or enhancing the games I was playing–whether I was writing a page-scraper to play a browser game for me or developing AddOns for World of Warcraft.

Anyway! The programming I’m doing now is focused much more on my writing and publishing. I’m helping maintain an e-book conversion and production tool, collecting and drawing some pretty cool sales reports with those same skills I used to hack old browser games, and even developing a couple commercial-level projects on the side for friends.

I set aside some time on Saturday to do just that. The project is…well, from the outside, it’s pretty boring. It’s a tool for easily, quickly, and accurately applying contextual labels to large batches of image files. But to me, it’s just a series of puzzles.

  • My friend says he needs to be able to handle non-numeric page numbers. I growl at the absurdity of the request (“non-numeric numbers”? really?), then figure out how to make my program handle that.
  • My friend says he needs to be able to make duplicates of all subsets containing more than 100 images. It’s a tedious process for him to count and copy and rename. It’s three lines of code for me.
  • My friend says he needs to be able to Undo when he makes a mistake (and it would be nice to save old copies of his data file just in case something bad happens to the working copy)….

When he brought up that last one, I shrugged and nodded. “No problem. That’s a normal thing in programming. To keep from wasting storage space, instead of saving lots of old copies of the data, we’ll just save the original document plus a list of changes. That way you can calculate the ‘current’ version by adding all the changes to the original, and you can revert to older versions just leaving out some of the changes.”

That really is an utterly normal thing in programming. Happens all the time. It’s a smart way to do things. And, hey, any program you use regularly supports Undo and Redo, right? How hard could it be?

So Saturday afternoon, when Xander was taking a nap and Annabelle was reading in her room, I settled down with the laptop to add revision history to my program.

Turns out…it’s not easy. I couldn’t find a standard library (where someone else had already done the work for me). I couldn’t find good examples. I had all the starting points, but they didn’t give me quite the information I’d expected to get, and I spent hours trying to figure out how to turn what I did get into something useful.

I spent six hours on it. In retrospect, that’s probably a pretty respectable time, but going in, I really expected it to be a half-hour job. After all, thousands of people do this sort of thing every day. I’m not a professional programmer, but I know all the basics (and I’m pretty good at the things I do often). Something so standard should have just made sense to me. That’s what I expected, anyway.

Anyway! The cool news is that I did end up getting it to work (after giving up completely on two separate occasions). Not only that, but I built my solution into a standalone file, so now I can incorporate that into any other program I want. For me, at least, it will be a half-hour task to add revision history to future projects.

I’ve been thinking about that experience a lot this week, because it carries a strong parallel with another one from the same weekend. On Sunday morning, I started outlining a Sherlock Holmes-style short story for my Auric’s Valiants series. The character is one we’d wanted in that universe from the start and, again, I’d just taken it for granted that I could whip up a Sherlock Holmes-style short story.

I did make it easier for myself by getting the whole Sherlock Holmes series on audiobook. I’ve been working my way through the series for weeks now, and it’s really good stuff. I admire the way Doyle balances the distant, refined narration with the visceral, evocative premises.

The stories have strong, consistent structure to them. That helps a lot. There are some pretty reliable elements, like the size of the cast, the number (and order) of clues, the misdirections, and so on. I felt like I could pretty easily mimic that structure, substituting in my own characters and setting.

But when I started outlining a short story in my scribblebook, expecting it to take about a page, I quickly discovered that the inputs didn’t automatically lead to the output. In fact, it turns out most of what goes into a great Sherlock Holmes story has nothing to do with Sherlock Holmes (or Dr. Watson). It took me fifteen pages of scribbling and a lot more energetic thinking than I ever expected it would, just to come up with an effective plot for a Sherlock Holmes story.

And I haven’t even started on the style and tone–the actual storytelling. Luckily, that’s the part I know how to do. It’s just like my programming problem Saturday: A given writing project can be a huge challenge for me, even as a professional writer, just to get to the point where I can do my kind of writing within the project.

But once I’m there, I’m virtually done. It might have taken me six hours to figure out the outline, but I’ll only need half that much time at a keyboard to get the actual story written. And now that I’ve figured it out, I can reuse it in future projects.

That sort of thing is fascinating to me. I love seeing the parallels between my disciplines. Just one of the many things I love about my job.

4 thoughts on “Discipline(s)

  1. Joshua Unruh

    I’m going to swoop in for the end of the the post and discuss your revelation of what is actually important in a Sherlock Holmes story. Big shocker, I’m going to use Batman to explain how you manage to have a detective character who is actually the protagonist of his stories. Well, there are two ways, and Sherlock eventually used the latter.

    This is all academic just in case you want to do it for this character later.

    You have to create a situation where every crime is taken personally by the Protagonist Detective. This isn’t really hard, but it may not be easy either depending on how original you want to be. In Batman’s case, he’s set himself up as a protector of Gotham City. He’s done this so completely that every crime there is like a personal attack. Part of this is exterior, letting criminals know that doing crime in Gotham is a personal affront to a really scary guy. But part of this is actually Batman’s tendency to rake himself over emotional coals. Every crime that happens in Gotham is, realistically, a personal issue for him.

    The second and easier way is recurring villains. Holmes eventually got this in Moriarty. They had personal animosity towards one another (in a very Victorian way) and whatever one did became a personal vendetta for the other. Probably moreso for Holmes than it did for Moriarty. Joker kills to get Batman’s attention and does it funny to get this grim guy to smile. The Riddler has to outsmart the World’s Greatest Detective. Catwoman wants to sex him up. And the bigger and more destructive their plans get, plans with this protector at the center, the more personal it gets.

    I dovetailed those pretty nicely!

    PS: These are things I’ve been thinking about since Monday night. Sorry to info dump them here.

  2. Alex Roxon

    Speaking as someone who spent quite a bit of their childhood obsessing over some of these online browser games, and making any and all kind of program that would gain me uh, *cough* unfair advantage, can I ask what games you used to focus on? It would be a pretty crazy small world if I’d known you/of you at some point as you were doing it (which would have been the case if you’d released any of your programs to particular online forums).

    Anywho, glad to hear the skills you picked up as a hobby are treating you well in the *real* world! It’s amazing what you can accomplish with a bit of know-how and ingenuity.

Comments are closed.