Monday, February 22, 2016

Writing: Algorithmic Approach - You won't believe what happens next!

I hate clickbait.

Writing programs… does this relate to writing fiction?

The things I write on this blog are my observations and things I learn. I am not telling you how to write well; I don’t know how to write well. But, I’m trying, and I’m sharing those experiences with you. Writing is the hard.

I’m a programmer at heart. I love shaping code and forcing the computer to do my bidding. I realized, very early in life, that everything is a program. Some of them, more complex than others.

Science has known that everything behaves within certain rule-sets for years. They may study genetic algorithms, behavioral, and so on.

How your dog behaves is nothing more than a complex program. X happens, dog does Y. The more complex the animal or situation, the more complex the program so let’s scale it back to something

Simple Ant Behavior

A simple diagram depicting typical, basic ant behavior.

easier to understand, like ants.


I’ve watched ants for extended periods of time. I’m a nerd; I like to know things. Anyway, I watch these little critters at work as they move around, following invisible chemical trails left by their comrades. One becomes injured, not my doing, I assure you, and the rest stop to investigate but ultimately they decide it’s too much trouble and they abandon the injured coworker.

Their programming is to go from Point A to Point B and gather food and return it to Point A. If they encounter an obstacle, such as an injured ant, they might secrete some of their alarm chemicals so other ants avoid that spot and they reroute the project. It is a relatively simple program. Plants have a program also, they are programmed to pull certain things in through the roots, other things from the air, grow and multiply.

Plants have a program also, they are programmed to pull certain things in through the roots, other things from the air, grow and multiply.

Sharks are programmed to swim around, looking mean, and occasionally eat a fish.



Writing can be looked at similarly. Here is an example of what is, in my mind, the most basic of algorithms.


Writing Algorithm

A basic flowchart for writing.

Let’s look at this more closely. I write something. Does it fit/work/belong? Yes? Great, go write another thing. No? Get it out of there, then go write something that does.


Now, if I follow this flowchart, I should be able to crank out pages of content that further my story along. If that was all there was to it, we’d probably all be writers.




But wait_thumb[5]


After cranking out a draft of a chapter, I have to go back and read it. I need to check for consistency, grammar, punctuation, tension, flow, pacing, etc.

The simple flowchart suddenly becomes a lot more complicated.

Adding to all of that, I have to write the next chapter!

That is the flow of my writing style. The actual algorithms are much more complex.

If A then B else C or D and E unless B and C then G with H or I but not J because K was U until X became P so A needs to G before the end of R.

Something like that. This is why notes are crucial to me. It’s also why I had to kill Mr. Annoying because I couldn’t keep his character straight in my head. Life is easier without him anyway. That jerk.

What if there was a formula I could apply to writing a paragraph? Well, there are several actually. If I adhere to writing using a single template then reading my work would become a dull, textbook-like experience: X, Y, Z then A, B, C then X, Y, Z…

I don’t think having a template is the ideal solution, but, good paragraph structure is paramount to writing well.