Alec Nevala-Lee

Thoughts on art, creativity, and the writing life.

Posts Tagged ‘Bjarne Stroustrup

How is writing like software development?

with 2 comments

Bjarne Stroustrup

  • The most important single aspect of software development is to be clear about what you are trying to build.
  • Successful software development is a long-term activity.
  • The systems we construct tend to be at the limit of the complexity that we and our tools can handle.
  • There are no “cookbook” methods that can replace intelligence, experience, and good taste in design and programming.
  • Experimentation is essential for all nontrivial software development.
  • Design and programming are iterative activities.
  • The different phases of a software project, such as design, programming, and testing, cannot be strictly separated.
  • Programming and design cannot be considered without also considering the management of these activities.

Bjarne Stroustrup, The C++ Programming Language

Written by nevalalee

August 31, 2013 at 9:50 am

A writer’s code

with 3 comments

Anagram generator from Foucault's Pendulum

One of the small pleasures in writing this blog—and in particular in coming up with the quotes of the day—has been a renewed appreciation of the affinities between writing fiction and computer programming. There’s a remarkably rich body of literature on the art of coding, and simply by browsing through the available works in search of memorable insights, I’ve come to realize that coders deal with many of the same problems that I’ve had to confront in my novels, especially structure, clarity, and managing complexity. Hacking, like writing, requires a balance between formal elegance and quick and dirty fixes, and a coder is often required to choose between ingenuity and readability: a clever solution may be beautiful in the moment, but it can be all but impenetrable if the author—or anyone else—comes back to pick it apart months or years later. And unlike novelists, coders get immediate feedback on the validity of their solutions from a rigorous, if somewhat unimaginative, reader.

The problem is that I haven’t done a lot of hacking on my own. Growing up, I spent hours messing with BASIC on an ancient “portable” computer that didn’t even have a hard drive. (My earliest program, written when I was thirteen or so, involved expanding the anagram generator that Umberto Eco provides in Foucault’s Pendulum to handle words of more than four characters.) Later, I took a computer science class or two in high school, but I haven’t done anything meaningful since.  More recently, I’ve found myself longing to jump back into programming for a fairly specific reason: not to do any serious coding of my own, and certainly not to get paid for it, but simply to gain access to the enormous amount of material written by coders on how they approach their work. Compared to the handful of well-worn tidbits that writers repeatedly invoke on craft, it strikes me as admirably pragmatic, dense, and varied, and even at a glance, it clearly has elements that I can put into practice.

A snippet of source code from Doom 3

This leaves me with the question of which language to learn, an issue that inspires predictably strong opinions on all sides. Not surprisingly, I made the final call based on the books I wanted to read. At the moment, I’m working through The C Programming Language by Dennis Ritchie and Brian Kernighan, which is generally regard as the best book of its kind, and I’m planning to follow it up with The Design and Evolution of C++ by Bjarne Stroustrup, which is one of those extended looks into a sustained design process that I find so irresistible, whether the subject is writing, animation, or cuisine. C and C++ might seem like odd choices for recreational coding, but they’re useful for my purposes because there’s so much source code available, along with what I can only describe as a highly specialized form of literary criticism, like Shawn McGrath’s recent appreciation of the beauty of Doom 3. There’s a whole world of material out there, and I’ve found that it only takes a little work to start to appreciate the basics.

Once I’ve played with C and C++ to my satisfaction, I’m hoping to jump into Lisp. This might seem like another strange choice, and I hope to explore it further in a future post. Suffice to say that Lisp, like C, offers a range of interesting reading material, from Paul Graham’s books on the subject to Douglas Hofstadter’s three essays in Metamagical Themas to Peter Seibel’s Practical Common Lisp. (Seibel, a former English major, is also the author of Coders at Work, which attempts to do for hacking what the Paris Review interviews did for fiction.) Lisp also strikes me as the most novelistic programming language, and the one with the greatest natural affinities to creative writing—but we’ll see. When you’re a writer, you’re always looking for tricks that your peers haven’t discovered yet, as well as any source of insight or competitive advantage, and given my interests and approach to craft, I think a deep dive into coding is the next logical step. Whether or not it yields anything useful is something I’m still waiting to find out. But if it does, you’ll be reading about it here.

%d bloggers like this: