Debugging Stories: How to Revise Like a Programmer

When hackers are shown in movies, they’re always frantically typing code. Unfortunately, this isn’t very much like real programming. Real programming does require writing code, but it’s usually not done very quickly. There’s often a lot of code reading involved, a lot of sitting and thinking, sometimes some discussion, and then a bit of typing. Even with a lot of forethought and careful testing, most programs don’t work perfectly. That’s when the programmer turns to debugging.

Debugging vs. Editing

Debugging is what programmers call the process of identifying and removing bugs from software — bugs being things that the software does that we really don’t want it to do. In some ways, it’s a lot like revising and editing fiction, although they obviously have their differences.

Computer programs are very literal. Programming is a creative process because there are multiple ways to make a given thing happen, but the instructions are either correct or incorrect. They do what you want, or they don’t.

In fiction, there are many more ways to do a given thing, and fixes are often qualitative rather than quantitative — mostly coming down to taste. Because of this, it’s often harder to tell that there’s something wrong with a story, or identify exactly what it is. There might be hundreds of ways to fix those problems in fiction. That can be a good thing or a bad thing, depending on how you look at it.

The Debugging Process

Debugging can be broken down into a few common steps:

  1. Identify possible problems
  2. Identify possible solutions
  3. Make a change
  4. Test
  5. Repeat as necessary

These same steps are a great roadmap for editing.

1. Identify the Possible Problems

It may seem obvious, but it’s hard to fix something if you don’t know what’s broken. As writers, we often have vague feelings that something’s not quite right, or not as good as it ought to be. This first step asks that we really try to identify what the problem might be.

Consider a novel that feels like it’s dragging in the middle. That’s the sort of vague critique that writers often face, but it’s not specific enough to “debug.” The middle might drag because the protagonist doesn’t have a clear goal, or because they’re not pursuing that goal, or because there aren’t enough interesting obstacles standing in their way. Maybe too much time is spent on a side character.

Try to figure out a problem that’s specific enough to describe in a sentence or two. If you think there are multiple problems, focus on one at a time. You may not be sure that you’ve figured out the actual issue. That’s okay. This is a scientific hypothesis. It will be proven or disproven later on.

2. Identify the Possible Solutions

Once a possible problem is identified, the obvious next step is to think about the ways it could be fixed. Don’t just run with the first idea you think of. This is a great time to do a little brainstorming. It’s easy to come up with ideas, but it’s more work to actually implement them.

The next step will be to implement your plan, but don’t throw away your other ideas immediately. You may think of a few improvements that naturally work well together and want to implement them all. Or you may find that the first fix you try doesn’t work, at which point you’ll want to come back and try something else.

3. Make A Change

This is the hard work, but you go into it well-equipped with a problem that you want to fix and a plan for fixing it. Take something out that doesn’t belong, add something in that was missing, or tweak what’s already on the page.

Occasionally, it’s apparent straight away that the chosen path is not going to work. Don’t feel obligated to write out a “solution” that didn’t pan out. You can always go back to steps #1 and #2. However, it’s important to write enough that you (or trusted readers) can make an informed decision about the change. It’s also important to differentiate between a bad solution and a hard one. A great solution that’s tough to implement might just need a few revisions to really shine.

4. Test

In software, once you think you’ve fixed the bug, you run tests to prove it. In writing, the only test that can really be performed is reading the new version. Depending on where you are in the writing process, it might be enough to read it yourself and make a judgement, or you may want to have other readers go through it, or even compare different versions.

The important thing is to make a decision: is it better than it was before? Is it better enough? If so, then you’ve solved your problem. Congratulations! If not, then you’ve got more decisions to make.

5. Repeat As Necessary

A failed improvement isn’t the end of the world. Difficult bugs don’t always get fixed on the first try. You just need to move back to a previous step and try again. If you now think you’re fixing the wrong thing, go back to step #1 and re-evaluate the problem. If you’re still convinced that you’re addressing the right problem, but aren’t satisfied with the result of your solution, go back to step #2 and try another solution from the list, or come up with new solutions.

It’s All About Problem Solving

This debugging formula isn’t a magic formula for success. It’s just a tried-and-true method for problem solving that can be applied to a variety of situations. Writing is an intensely personal experience, and it can be frustrating and disheartening when a story you love just isn’t working. Sometimes writer’s block is just the writer’s brain flailing in the face of an annoying problem.

These steps can provide a dispassionate process for working through that frustration. Addressing the problem through small steps with clear goals makes the problem itself seem less overwhelming. The option to backtrack and try again makes failures seem more like setbacks than crushing defeats.

So next time you run into a big “bug” in your story, don’t just blindly revise in hopes of fixing it. Debug it!

Writing Spikes

My day job is software development, and once in a while I find some useful crossover in concepts between programming computers and writing fiction. Today, I’d like to take one of those software concepts – the “spike” – and apply it to fiction.

What is a Spike?

In software development, a spike is an experiment. It is writing code in order to answer a question or test a solution to a problem. Implicit in the idea of a spike is that this is “throwaway” code. It’s not expected to go into production.

When to Try a Spike

The goal of a spike is to take an infinite number of possible storylines and reduce them down to the best one. The most obvious place to try a spike is when you know your story could go in several interesting directions, and you’re not sure which one is the best option. Think of your story in terms of alternate universes. Each choice, each universe, differs at this specific point. As the author, it’s your job to find the most interesting universe, and discard the others.

A less obvious opportunity for a spike is when you don’t know where your story is going next. You may be doing some exploratory writing, and run into a bout of writer’s block. Or you may still be working on your outline. Often, when we feel like we have no ideas, we’re really just letting our inner editors censor us. Chances are, you have some “bad” ideas that you’re reflexively throwing away. Instead, use them as fuel for a spike.

The other useful time for a spike is when you reach an important inflection point in the story. This could be a major event for some of the characters, a big reveal, or a turning point in the plot. These are the moments that people talk about when they discuss books they love.

This might seem like a strange place to experiment. These moments are often the seeds of a story that first take shape in my mind, and make me want to write it in the first place. Why mess with a good thing?

Well, the human mind is lazy. Tropes and stereotypes thrive in comfortable, familiar territory. When we run with the first idea that comes to mind, those same well-worn, rehashed ideas can start to sneak in.

If these are the shiniest, most important bits of the story, shouldn’t they be as great as they can be? The worst that can happen is that you come up with bad alternatives, and you confirm that your original idea was the best.

The Steps of a Spike

You can do a spike during outlining, while writing, and even in revision (although you may end up making even more work for yourself). You just have to tailor your scope and output to where you are in the writing process.

First, get your mind into brainstorming mode. Define all the options. If you have a hard time coming up with possibilities, consider setting a specific number of options, and forcing yourself to come up with at least that many. Sometimes, great ideas come when we’re struggling, and we force ourselves to reach for the strange or unexpected. These options don’t have to be detailed. A list of bullet points is enough.

Once you have enough options, you’ll need to decide how many you want to pursue. A good default is three options, but this is entirely up to you. You may only have one – an alternative you want to try. Spikes are a balancing act. Remember, they’re designed to be disposable. You’re going to do some work, and then throw some of it away. Let that free you. That work isn’t wasted – it’s ensuring that whatever you decide to keep is the best it can be.

Next, it’s time to define the limits of your experiments. You can set a number of pages, number of words, or a time limit for each option. Once again, balance is key. Spend too much time or too many words on too many options, and the project will never be finished. The goal is to be confident about which option is best.

Evaluating the Results

Again, every spike is an experiment. You made your choices, and you wrote something for each one. You may have some additional notes as well. These are the results of your experiment. Now, you need to evaluate them.

If you have a confidant, spouse, editors or beta readers, and they’re willing to take a look, you may want to solicit feedback. They might see something special that you missed in one of your experiments. They might also catch a gaping plot hole. They might react more or less strongly than you expected.

Whether you get feedback from someone else, it’s time for a final decision. Evaluate each of your pieces and pick with the confidence that you’ve now thoroughly explored your options.

Finally, do some revision. If you felt hemmed-in by the time/page/word limits you set for yourself, now is your opportunity to expand and improve. Maybe you thought of something in paragraph ten that you could have set up more effectively in paragraph two. Like a science experiment that gets refined into a commercial product, you can take your proof of concept and polish it to perfection.

That’s it! A spike really isn’t complicated – just a controlled comparison between a set of options. But it’s good to remind ourselves that sometimes it’s okay to try things out, even when it might feel like a waste of words. You never know when that strange idea you set aside might change your story for the better.