On Programming and Prose

Date March 1, 2010

A huge thank you to Robert for this opportunity to write here today. He’s a fellow programmer, which makes him a brother — a pasty-skinned, carpel-tunnel suffering brother who can probably think of a few computer science jokes on the spot. I’ll go first:

Q. How many programmers does it take to change a lightbulb?
A. None. It’s a hardware problem.

When I first solicited help in organizing a virtual book tour, Robert was quick to respond, and suggested I write about writing a book.

Douglas Adams once said that writing is easy. “You only need to stare at a piece of blank paper until your forehead bleeds.”

I’m not a writer by education; it’s a career I kind of fell into. When I came up with the idea for Red Planet Noir, it was on a lark, more of an academic exercise than anything, but when I stared at that first, completed page, I thought, “This isn’t terrible.”

Which was pretty good for me. I’d spent most of my life writing terrible. I knew terrible. “Not terrible” was a pleasant change.

A year later, I’d written eighty-thousand words.

It wasn’t always easy. (I wrote a third of the novel during my downtime in in Afghanistan.) But ultimately, I followed a few simple rules I learned in computer science to bring the project to conclusion.

1. Adherence to ritual.

When I was a student, I haunted the LSU Unix lab at the same time every evening. I followed (bizarre) naming conventions for my code. (Just for the record, every program was named after an animal howl of some sort. AHOOO or ROWR or BAROOO or whatever — that is what extreme levels of caffeine do to the human brain. It made sense at the time.) And I worked consistently, with short breaks to decompress. Unless there was an unavoidable deadline, I left at the same time every night.

Writing fiction is not much different. For most of the book, I arrived at the office every morning around 6am. (Because the office didn’t open until 7:30, I really impressed everyone with my devotion to the company.) That gave me a good hour and a half of silence to focus on the literature. At 7:30, I hit Save and put it away.

Ritual helps take the focus off how difficult the project might be, and reframe it as something that’s just done every single day. Writing is not like on television or in the movies, where an author rents a villa in Tuscany and hammers out a quick novel between dinner parties. It’s a job.

2. Obey Carmack’s Law.

In his famous Black Book, Michael Abrash coined Carmack’s Law as “Fight code entropy,” stating, “If you have a new fundamental assumption, throw away your old code and rewrite it from scratch. Incremental patching and modifying seems easier at first, and is the normal course of things in software development, but ends up being much harder and producing bulkier, markedly inferior code in the long run.” The Carmack in question was, of course, John Carmack of Id Software, and the project the two worked together on was Quake.

Editing a manuscript is no different. Red Planet Noir took a year to write, and six months to edit. The edits were two and three hour sessions, seven days a week. (I worked in the evenings due to the amount of time required.) Early on, much of my time was spent learning how to edit. I tried the piecemeal approach, changing a word here and a sentence there, and at one point I spent an entire week on a single page. It never occurred to me to apply Carmack’s Law to literature. But when I did, the project sped through to conclusion. Instead of getting lost in adverbial clauses, or scraping my brain for a better way to describe a building using pre-existing text, I liberally tore pages from the manuscript and started fresh. The rewritten pages were always an improvement.

3. Seek elegance.

Famed computer scientist Edsger Dijkstra often wrote about the importance of elegance in programming. It’s not enough to write code that is mathematically correct. By that standard, unwieldy spaghetti-works of kludgy, obfuscated code is acceptable. Elegant code, on the other hand, not only works right, but feels right. It’s simple and thoughtful. Though hard to describe to “outsiders,” programmers can identify elegance on sight. It’s like Mozart on strings versus a child banging on a pot. It is a thing of beauty.

The same is true for literature.

However, just as an inexperienced software developer cannot inherently write elegantly, neither can an inexperienced reader. To write ten thousand good words, an author must read ten million good words. Reading is an inescapable requirement for writers. The more one reads, the easier it is to spot not only good prose, but to understand why that prose is good.

Raymond Chandler was a master of elegance. Consider this paragraph from Trouble Is My Business:

There was a desert wind blowing that night. It was one of those hot dry Santa Anas that come down through the mountain passes and curl your hair and make your nerves jump and your skin itch. On nights like that every booze party ends in a fight. Meek little wives feel the edge of the carving knife and study their husbands’ necks. Anything can happen. You can even get a full glass of beer at a cocktail lounge.

Or perhaps the master, Vladimir Nabokov, as he opened Lolita.

Lolita, light of my life, fire of my loins. My sin, my soul. Lo-lee-ta: the tip of the tongue taking a trip of three steps down the palate to tap, at three, on the teeth. Lo. Lee. Ta.

She was Lo, plain Lo, in the morning, standing four feet ten in one sock. She was Lola in slacks. She was Dolly at school. She was Dolores on the dotted line. But in my arms she was always Lolita.

Rare is the writer who deserves mention in the same breath as Nabokov or Chandler, but writers should always strive for the example of elegance set by the two men.

Good, mechanical, grammatically-correct prose is never good enough. To quote Obi-Wan Kenobi, “Stretch out with your feelings…”

This is but a smart part of the process. Next week, on author Mindy Blanchard’s blog, I will give a nuts-and-bolts description of the business of books — what happens once an author types THE END on his or her baby. Tomorrow at writer Marian Allen’s blog, I’ll be discussing voice and style in the noir genre. I hope to see you there.

D.B. Grady is the author of Red Planet Noir.
He can be found on the web at http://www.dbgrady.com.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • Ma.gnolia
  • NewsVine
  • Propeller
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Simpy
  • Sk-rt
  • TailRank
  • Technorati
  • TwitThis

Leave a Reply

You must be logged in to post a comment.