Computer programming & writing fiction: Is coding art?

Girl with an 8-bit EarringIn my last post comparing writing programming and writing fiction, I concluded both were similar because of their relationship with their practitioners. “Art is a kind of recruiting poster for itself,” I wrote. “An art attracts its own artists.”

Wait—is computer programming art? It’s accepted to call fiction art, but can computer programming really be considered

the conscious use of the imagination in the production of objects intended to be contemplated or appreciated as beautiful, as in the arrangement of forms, sounds, or words. (The Free Dictionary)

Think of what programming a computer really boils down to: Ordering and organizing a series of mathematical instructions followed precisely by the machine. The computer is allowed no imagination in its interpretation of those instructions (if it possessed an imagination, which it doesn’t, at least not today). If there’s an art in computer programming, it stands in the purview of the programmer, not the machine. That’s how it should be. The art of painting is not in the tubes or cans of paint, but in the painter.

But is the arrangement of those computer instructions somehow “beautiful”?

It’s important to discern a difference between a computer program being art and the act of programming as an artistic form. Let’s start with the latter.

I believe programming is an art form, at least by modern notions of the term. Writing fiction and writing code requires continuous subjective decision-making during the entire process (a “conscious use of the imagination”). A personal fervor is vital for quality results. When a writer lacks that fervor, it shows in the end result, both for fiction and computer programs.

Programming is not a rote process of memorization and recall. There is no “correct” way to write a computer program but, like writing a novel or a short story, there are many wrong ways.

Bill Atkinson, creator of the original MacPaint, painted in MacPaint. (Daniel Rehn, CC BY 2.0)

Bill Atkinson, creator of the original MacPaint, painted in MacPaint. (Daniel Rehn, CC BY 2.0)

Coding requires taste, aesthetics, and an eye for detail. Programmers develop deeply personal philosophies. Some coders prefer verbosity (like Henry James in his later years) while others prefer economy (like Hemingway or Cain’s early work).

There’s a scene in August Wilson’s Fences that is one of the most distilled scenes I’ve ever read: The father and son debate buying a TV to watch the World Series. On the surface a mundane domestic moment, the scene is actually Fences in-miniature. The beauty of this scene mirrors brilliant software design, where each piece of the program is intimately connected to the entire application.

Years ago, I could always tell when I was working with a programmer who started coding on the Macintosh versus a programmer weaned on Microsoft Windows—the two companies have distinct programming styles and philosophies. Programmers who learned to code on those operating systems carried those styles and philosophies with them to other platforms and projects.

A computer program can be functional, operating, and seemingly free of bugs, and a programmer may still read the code and say it doesn’t “look” right. (The trendy term for this is “code smell.”) What’s more, two programmers may say a program doesn’t “look” right for entirely different reasons. This reminds me a great deal of the world of poetry, where poets may agree a poem is poorly executed and then squabble over the reasons why. (There’s similar disagreements in the world of fiction, but I find them to be less…doctrinaire.)

Writing and programming both involve elements of discovery and improvisation. Even though I’m writing a series of blog posts advocating outlining stories before writing them, I don’t believe an outline can—or should—contain every detail present in the final story. An outline should not be so rigid as to prohibit discovery during the writing process.

For a long time, there was a big push to eliminate discovery and improvisation in the world of software development, as “discovery” and “improvisation” seem undesirable in a field of proper engineering. (In the 1960s, IBM famously discovered that the number of bugs a programmer produced was proportional to the amount of code he or she wrote. Their solution: limit the lines of code a programmer could write per day, a logic straight from the pages of Catch-22.) Newer software philosophies, notably Extreme Programming and Agile development practices, have flipped that thinking and embraced discovery and improvisation as healthy and necessary.

Suspicion of programming as an art form probably springs from a general lack of understanding of how programs are written. Programmers share an arcane terminology among themselves. They build and manipulate mysterious machines that have come to play a powerful, sometimes menacing, role in our lives.

<cite>Ex Machina</cite>, a 2015 film about a computer programmer who falls in love with an artificially intelligent android.

Ex Machina, a 2015 film about a computer programmer who falls in love with an artificially intelligent android.

That suspicion probably also arises from stereotypes. Programmers don’t look like artists. In popular culture, programmers are portrayed as geeks more comfortable around machines than humans. Sometimes they even fall in romantic love with a computer. (Never mind that this trope originated in antiquity and regards an artist and not a bricklayer or farmer or soldier.)

Another reason people question programming as an art is that computer programs “do” things. There’s an academic suspicion of pure art having any sort of utility, probably due to fears of commodification and commercialization. We don’t think of Vermeer’s Girl with a Pearl Earring as “doing” anything other than hanging on a wall in some drafty museum, but it must be doing something to cause people to stand in line for hours to view it. It’s funny, this idea that pure art doesn’t “do” anything when it so plainly does. If art didn’t do anything, why would we care about it?

And this rolls back to the distinction I made earlier: Is computer software itself art? I’ll challenge the question with a question in return. We regard skyscrapers and bridges and automobiles and colanders as kinds of art. We laud architects, automotive designers, and commercial illustrators as artists. Why treat computer programs and their creators differently?

Colander, c. 1600 - 1650, Museum Boijmans Van Beuningen

Colander, c. 1600 – 1650, Museum Boijmans Van Beuningen

Computer programming & writing fiction: Art as a recruiting poster

IBM SelectricHow is computer programming like writing fiction? Is writing code anything like writing stories?

When I was young, perhaps seven or eight, I banged out my first short story on a second-hand IBM Selectric typewriter my mother brought home from her office. Powered on, the Selectric vibrated the whole desk and emanated a low mechanical hum, some unseen engine in the contraption idling. I still recall the tang of the ink in the typewriter ribbon and the satisfying, officious schock as the typeball jumped from its perch and tapped lettering onto the crisp onion paper I’d fed into the roller.

The story I wrote was a retelling of Richard Connell’s “The Most Dangerous Game” transplanted to a science-fiction setting. (In fact, I think I creatively titled it “The Most Dangerous Game in Space”.) My determination to spend hours coping with that unforgiving contraption went beyond an affinity for the classic short story. As an avid young reader, I’d come to wonder if I could pen my own fiction. My aspirations weren’t so bold as to imagine being published, only to see if I could write my own, but later that dream crept in too.

The Most Dangerous GameAround the same time (this would’ve been 1979), I cajoled my parents into buying a home computer. Silicon Valley was marketing home computers as personal productivity assistants, devices to balance one’s checkbook, manage a home mortgage, track stocks, and so on. Home computers were also being pitched as tools to give students an edge in school. I couldn’t care less about schoolwork—and I’ll be damned if that computer ever balanced my parents’ checkbook—but with a home computer I could play video games, my only real motive for wanting one.

Innumerable hours playing videos games led me to try to write my own. It was a natural progression, just as reading I, Robot set me to thinking of my own robot stories.

I never did write a video game, at least not one that anyone would want to play, but software development did become my career path, one I’m still following over 35 years later.

Likewise, although I didn’t finish that short story, writing fiction remains an important passion in my life, even more important than programming.

Walking these paths, I’m sometimes asked if writing software and writing stories are the same. Or, at least, if they bear any similarities. And my answer is, yes, there are commonalities between the two.

I’ll explore more parallels in the future, but already I’ve alluded to one thing they have in common. I’ve never met a good writer who wasn’t first an avid reader, and I’ve never met a good programmer who wasn’t first an avid computer hobbyist.

Art is a kind of recruiting poster for itself. An art attracts its own artists.

Next: Is coding art?

The Drifting Paige reviews Bridge Daughter

The Drifting PaigeBook blogger The Drifting Paige recently published a flattering 5 out of 5 review of Bridge Daughter. To quote:

This is an incredible scifi novel that bridges (ha) the gap between religion and science. It is so emotionally superb and is not overhanded with any of the themes … Nelson achieved the nigh impossible. You learn and grow with Hanna, you come to understand the world she exists in and the choices that she has to make…

I would suggest this novel to everyone- it is intelligent, gripping, and hard to put down. … Nelson is a tried and tested author, and I genuinely suggest his book to all scifi and high fantasy lovers.

Read the entire review (which masterfully avoids dropping a single spoiler) at The Drifting Paige. If you haven’t already, download a preview of Bridge Daughter at Amazon.

Sherlock by train

Sherlock Holmes & Dr. Watson by Sidney Paget (1860-1908) (Strand Magazine)Last summer I had the great fortune to spend ten weeks in Japan. I traveled by train up and down the islands, from the agriculturally diverse Hokkaido to the richly historical city of Nagasaki at the southern tip of Kyushu. Japan is a fugue of culture, architecture, and landscape. The country never repeats itself, but is stitched together by interlocking themes.

On one leg of the trip I made the key mistake of failing to pack a second book, thinking B. Traven‘s The Death Ship was a hefty enough read until my return to Tokyo. Well, I ripped through The Death Ship in no time (a great novel, by the way) and found myself facing a long stretch of time on Japan’s shinkansen (bullet train) without a thing to read. Even if I understood Japanese, Japan’s trains are not like other systems where you might chance on a discarded newspaper or a light magazine in the seat-back pocket. The Japanese do not leave their detritus behind when they detrain. They even pick up their trash when they exit a baseball game.

Desperate, I searched my smartphone and discovered on my Kindle app The Adventures of Sherlock Holmes (1892), the first published collection of Holmes’ adventures. Most of the collection’s story titles are as well-known as books of the Bible: “The Adventure of the Red-headed League”, “A Scandal in Bohemia”, “The Adventure of the Speckled Band”, and more. The stories have fallen into the public domain, hence the collection is often the free sample book Amazon supplies when you buy a Kindle or install their app.

Before my trip to Japan, I was never a fan of Sherlock Holmes. I found the Victorian airs and British pleasantries stuffy compared to Holmes’ American counterparts. When I first read “The Adventure of the Dancing Men” at age ten or eleven, I was going through a boyhood codes-and-ciphers phase. By all rights I should have loved the story. Instead I felt a bit let down by its lack of focus on actual cryptanalysis. As I learned on that train ride, Doyle’s stories are often more concerned with a viscount’s ancestry or Tsarist intrigue or preserving the good name of the British Empire than the dead body lying at Holmes’ and Watson’s feet.

All this is to explain that although I’ve read mystery fiction my entire life, from Encyclopedia Brown at the age of seven to the adult pleasures of Chandler’s The Long Goodbye (which I reread every few years), on that bullet train ride I was not terribly conversant with the Sherlock Holmes corpus. I’d read The Hound of Baskersville a few years before at an acquaintance’s suggestion when I mentioned I’d enjoyed the neo-Gothic Rebecca. Other than some Sherlock Holmes movie spoofs and casual viewing of Jeremy Brett’s BBC series, my exposure to the detective was largely through cultural references and the turns of phrase that have entered our common language, much like someone ignorant in Shakespeare will recognize bits of Hamlet.

Something wonderful happened on that train ride from Tokyo to Kyoto. As these stories of detection and deduction spooled out before me, I realized much of Doyle’s contemporary British audience would have been reading these stories on trains as well. Since he was writing for Strand magazine, Doyle’s audience would’ve picked up a copy at a newsstand before boarding, the Victorian version of downloading an app before a long plane ride.

The cadences and rhythms of Doyle’s stories almost appear crafted for train reading. The percussion of the shinkansen tracks below and the low whistle of the passing wind was the perfect white noise to accompany a Holmes mystery. More than once I started a story as our train left the station, and by the time Holmes was announcing his solution, we were slowing for our next stop. Obviously Doyle wasn’t timing his stories for bullet trains, but it felt he crafted them with a sense of being read in a single sitting between destinations, whether traveling by steam or horse or electromagnets.

How often does Holmes send Watson scurrying to locate a train schedule to confirm some paramount clue or destroy an alibi? Or does Holmes engage in mysterious research in London before setting off by train first thing in the morning, only revealing the details of his research to Watson on the ride north?

Holmes and Watson call for cabs, hire carriages and watercraft, borrow steeds, follow bicycle tracks, and so on. Freedom of mobility is vital to a Sherlock Holmes story. It’s the core question in “The Adventure of the Solitary Cyclist” and “The Adventure of the Copper Beeches”. A horse-and-carriage ride is the central puzzle in “The Adventure of the Engineer’s Thumb”. The climax of A Study in Scarlet involves, of all things, hailing a cab off Baker Street.

All fiction writers are writing to a perceived readership, whether they acknowledge it or not. This is distinct from a “target audience,” which commercial writers are all too familiar with. (A staff writer for Wired magazine will consciously know her target audience, which is distinct from the target audience for a sportswriter in a Midwestern farming community.) My notion of a “perceived readership” is more personal than a target audience, a writer’s internalization of their desired audience rather than a market demographic.

Some writers write with magazine editors and agents and publishers in mind—people they hope will publish the story they’re crafting. Some writers think of authors they admire or authors they desire to emulate. Some writers are thinking of friends and family whom they hope to impress, or at least earn their respect. Some writers are thinking of the public at large (whatever that abstract concept means) hoping to earn a wide audience.

Unlike “target audience,” it doesn’t mean the writer is actually writing for this perceived reader. The writer doesn’t actually believe only their friends will read their book, or that some big-name writer will pick it up, especially since that big-name writer may be dead. But just as painting a house requires a house to apply the emulsion, a perceived readership in the back of a writer’s mind gives the writer a kind of fuzzy target to aim for without committing to it.

By the time I returned from Japan, I’d devoured three Sherlock Holmes collections. For all the faults and stuffiness, Doyle is a generous writer, one who engaged with his readership and even challenged them a bit, but never denying them their desires. I suspect Doyle (like Dickens) read correspondence from his readership and was sensitive to their criticisms and praise. I don’t think it’s an accident Doyle modeled his first-person narrator as a physician, his own intended profession, and that Watson wrote of Holmes’ exploits as though writing a newspaper article. Not only did it give the public the sensation Holmes lived—many believed so at the time—but Watson’s audience also gave Doyle the house for which to apply the paint.

Doyle’s perceived readership began to coalesce with his target audience, like blurry double-vision sharpening into a single distinct form. I’m not arguing this is desirable or advantageous, but I do think it happened and that Doyle’s writing was the better for it. I also believe this is part of the reason for Sherlock Holmes’ character persisting as a vivid creative construct well into the 21st century. After all, Holmes’ as an individual is not some empty vessel for each generation of readers to pour their own ideals into. His persistence is that he’s odd, unique, idiosyncratic, and ripe for reinterpretation.

This connection between author and perceived readership is a direct rebuttal to the 20th century myth of the “walled-off” author, the lone genius in a room with a typewriter penning works of art unsullied by mammon or mass culture. While Nabokov, Faulkner, and Woolf may not have be writing for money and fame—although I think people are too quick to assume such things—I certainly believe all three were writing for a perceived readership, some idealized notion of the reader they wished to attract.

With the rise of ride-sharing like Uber and Lyft, and with the inevitable arrival of driverless cars in the future, we may experience a fresh resurgence of people with additional time on their hands to read. Who knows? Much as digital music led to the renewal of singles, there may soon be a burgeoning market for short stories and story collections, mysteries and otherwise, for people who seek a brief sojourn while traveling between Point A and Point B without a steering wheel in hand.

What kind of story matches the cadences and rhythms of a self-driving car? Can America produce writers as sensitive and generous as Doyle to produce such work?

Quote

Publishers Weekly reviews Bridge Daughter

Publishers WeeklyPublishers Weekly has reviewed Bridge Daughter and I couldn’t be more pleased. An excerpt:

Nelson … smoothly realizes a provocative alternate present seen through the eyes of naive adolescent Hanna Driscoll. … Hanna is an engaging protagonist, and her thought-provoking story blends action, introspection, and social commentary in a stark but indirect critique of efforts to control female bodies and restrict reproductive rights.

I’m honored to be reviewed by Publishers Weekly, negatively or otherwise, and such positive comments are more than welcome. Read the entire review, and if you’ve not picked up a copy of Bridge Daughter, you can start by going here.

Quote

Greatest rejection letter of all-time

Galaxy Science Fiction, March 1953Recently I picked up Robert Silverberg’s superb Science Fiction 101: Exploring the Craft of Science Fiction, an unfortunate title for a remarkably sturdy book. Part memoir, part writing guide, part anthology, I’d recommend it to every writer whether or not they’re interested in science fiction as a genre or pursuit.

Silverberg mingles his breezy autobiography of struggling to get published as a young man in the 1950s with nuggets of practical writing advice he picked up along the way. All of this package is humbly offered to the reader. Even when penning the book in 1987, Silverberg remains in awe of Asimov, Bradbury, and Heinlein (“our Great Exception in almost everything”), although by that time Silverberg’s name was mentioned in the same breath as those masters, and more.

Galaxy Science Fiction, August 1951Science Fiction 101 also reprints thirteen classic science fiction stories from authors like Damon Knight, Philip K. Dick, Robert Scheckly, Vance, Pohl, Aldiss…the table of contents reads like the short list of first-round inductees to The Science Fiction & Fantasy Hall of Fame. Alongside each story, Silverberg comments on why it impressed him and what he gleaned, offering hard, complete examples to his writing wisdom that so many other guides lack.

It’s fair to compare Science Fiction 101 to Stephen King’s On Writing. Both books are a bit more practical and pragmatic in their advice than loftier musings on the craft, such as John Gardner’s The Art of Fiction. I suspect Gardner would peer down his nose at writing advice from Silverberg or King, which is too bad. Anyone who can forge a lifetime career with pen in hand deserves to be listened to and considered.

As a young man, while sweating over a typewriter struggling to earn publication credits in the science fiction magazines of yore, Silverberg also earned a degree in English Literature at Columbia University. He applies some of that study here, coming up with incisive observations about storytelling I’ve not seen made before. Offering advice on how to build a story, Silverberg does something wonderful and avoids the conflict word. I’ve discovered “conflict” is off-putting to some young writers, possibly because it suggests violence or supercharged stakes or overwrought emotions. Instead, looking back to the ancient Greeks, he frames story as propelled by dissonance:

Find a situation of dissonance growing out of a striking idea or some combination of striking ideas, find the characters affected by that dissonance, write clearly and directly using dialog that moves each scene along and avoiding any clumsiness of style and awkward shifts of viewpoint, and bring matters in the end to a point where the harmony of the universe is restored and Zeus is satisfied.

It’s not the final word on how to write a story, but it’s a surprisingly serviceable start.

Galaxy Science Fiction, November 1951Silverberg’s candor and generosity to the reader is so no-nonsense, he even reprints the rejection notes he received while canvassing science fiction magazines with his early work. Big-name writers usually dip into their rejection stack for the wrong reasons: to settle a score, or thumb their nose at those who stood in their way years past. Here, Silverberg reprints rejection slips that served to make him a better writer, admitting how he deserved them, and how he was often too young to take their advice at face-value.

My favorite rejection letter comes from H. L. Gold, editor of Galaxy Science Fiction. Galaxy was a bit before my time (I grew up reading Analog, Asimov’s Science Fiction, and The Magazine of Fantasy & Science Fiction). but Galaxy was well-known to me merely by its reputation. Galaxy was a “serious” science fiction magazine, known for avoiding the lewd subject matter and titillating covers the other science fiction magazines lured in readers with. (I’ve included a few of Galaxy‘s best covers here. The Internet Archive has a remarkable collection of back issues, covers and inside matter, that’s well worth perusing if you have any interest in science fiction’s past.)

Galaxy editor H.L. Gold sent Silverberg this rejection in 1956, when Silverberg had already broken into the field and was padding the back pages of science fiction magazines:

You’re selling more than you’re learning. The fact that you sell is tricking you into believing that your technique is adequate. It is—for now. But project your career twenty years into the future and see where you’ll stand if you don’t sweat over improving your style, handling of character and conflict, resourcefulness in story development. You’ll simply be more facile at what you’re doing right now, more glib, more skilled at invariably taking the easiest way out.

If I didn’t see a talent there—a potential one, a good way from being fully realized—I wouldn’t take the time to point out the greased skidway you’re standing on. I wouldn’t give a damn. But I’m risking your professional friendship for the sake of a better one.

Robert Silverberg was 21 when he received this remarkable letter, perhaps the greatest rejection letter of all-time.

Quote

Tasty review of Bridge Daughter at The Hungry Bookworm

The Hungry BookwormThe Hungry Bookworm posted a foodie review of Bridge Daughter earlier today. Hungry Bookworm combines book reviews and cooking in a rather delightful way, offering recipes that complement the book or its subject matter. Blogger dreammkatcher paired Bridge Daughter with Lemon Zucchini Pancakes, an interesting choice considering the role pancakes (and flapjacks!) play throughout the novel:

A strong character, I found myself sympathizing with Hanna and rooting for her until the very end. The morning her mother forces her to make pancakes for breakfast, it becomes clear things are shifting for Hanna. Later on, pancakes are on the table again as her life takes another unexpected turn.

I’m sure Hanna made traditional breakfast pancakes, but since I decided to make them for dinner, I opted for a more savory recipe – Pancakes with a Heart of Gold. An apt name, I think, as Hanna counts on the goodness of many along the way.

It’s a great concept, pairing recipes with books. Read the whole wonderful review, and if you make these savory pancakes, I hope you accompany the meal with a setting of fresh-picked flowers.

Bridge Daughter is available at Amazon in Kindle and paperback editions.