Cutting the “Spaghetti Code” out of your Novel

eBook publishing is lowering the quality of fiction! eBooks are poorly edited, and twice as long as they need to be!

Sounds like a job for a programmer.

One of my favorite programming terms is “spaghetti code”. It refers to code that is longer than it needs to be. Sometimes this is because the code is over-complicated, doing things it doesn’t need to. Sometimes actions that are repeated can be condensed into a single function. And sometimes the solution is simply the wrong one and should be replaced with a shorter more elegant solution.

Over-complicated, redundant, ineffective. These sound like literary criticism to me!

There are several reasons why spaghetti code exists:

1) A lack of experience in the programmer.
2) Newer hardware has made it easier to “get away” with slower code. You can always slap in more RAM or a faster processor if the program runs slowly.

A good piece of code should be understandable just by looking at it. Often all of the essentials of what is being done can be seen on a single screen. Sometimes a more detailed read is necessary to fully appreciate it, but the basic idea of the code should be apparent from a first glance.

How does this relate to writing, specifically to eBooks?

Prose can be a lot like code. An action that is repeated may only need to be described once to convey its meaning. The story moves more quickly if the author uses 10 words to say something rather than 100. And eBooks present some of the problems of newer hardware. Books aren’t limited by paper and material costs in their electronic form. I can write 70,000 words or 250,000 and other than the time it took me to write it, there is no cost.

I write spaghetti code the first time out. That’s called a rough draft. A good programmer takes their initial idea and refines it to its most elegant solution. A good author takes what was said in 100 words and says it in 20, and determines what needs to be said at all.

It’s a revision night. I have some debugging to do.

What other ways do you think about your writing or programming? Does anyone know why we programmers single out spaghetti instead of linguine?

Advertisements

3 Comments

Filed under Trube On Tech, Writing

3 responses to “Cutting the “Spaghetti Code” out of your Novel

  1. I really like this description. I, too, write “spaghetti code” in a first draft. I’m going to keep this term in mind from now on. 🙂

  2. Pingback: And We’re Back – The Very Inspiring Blogger Award | Ben Trube

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s