Timothy Finley

Dr. Matthew G. Kirschenbaum

English 467

10 May 2004

Programming as Writing as Literature?

There long has been a divide between academics involved with the study of humanities and those in the study of science. In 1959, C.P. Snow published The Two Cultures in which he expressed the growing disparity between these two schools of thought. Disparity has continued to grow, particularly with the advent and widespread use of modern technology (Two Cultures or One). It is with these thoughts that the controversial question is asked: is programming writing? Before delving in to this question it is necessary to define the bases of the argument.

What is programming? As defined at dictionary.com, programming is “to provide a machine with a set of coded working instructions” (American Heritage). More informally, the act of programming creates an executable computer program from a set of codes called a programming language. Programming languages are numerous and range from very detailed and machine-like (coined low-level) systems such as assembly language to more advanced and abstract (high-level) systems such as Java, C/C++, and Python. Although the goal of programming is to create a program, compiling is an intermediate step required to produce a program. A compiler takes the textual sources (source code) that the programmer created, translates it into code that the computer understands (machine language), and outputs it as a program.

What is writing? At the simplest of levels, writing is merely “the act of creating written words” and “anything expressed in letters of the alphabet” (Wordnet). At a higher and more specific level, writing is “the work of a writer; ... especially when considered from the point of view of style and effect” (Wordnet). In this sense writing more than just illustrated symbols, but it must achieve more stylistically. Using the definition, “A written work, especially a literary composition” (American Heritage) narrows the argument to deal with the comparison of literature and programming, allowing further and more engaging questions (but also requiring another definition).

What is literature? Literature is, “Imaginative or creative writing, especially of recognized artistic value” (American Heritage) and is also “distinguished for beauty of style or expression, as poetry, essays, or history, in distinction from scientific treatises and works which contain positive knowledge” (Webster's Revised). It is not surprising and important to note that by one of its definitions literature is contrasted from scientific writing.

As mentioned above, the question is programming writing? is rather uninteresting. If it is the case that a programming language is a real language then programming is certainly writing. If that can be established then the following more interesting question is: is programming literary? This question can be further broken down into smaller concepts based on the definition of literature, which involve creativity, art, beauty, style, and expression.

In the following discourse, the above questions will be analyzed from two different perspectives. In the first, the term programming will refer to all forms of programming. Specific examples and kinds of programming will not be referenced, but instead programming as a whole will be analyzed. The second perspective will focus one specific form of programming due to its particularly “literary” qualities. The discussion will conclude by talking how the latest trend in programming today, the open source movement, can relate to programming as literature.

* * *

The entry point for the discussion looks at the question is a programming language a language? Although there a few rare programming languages (BrainF*** and Befunge) that are made entirely up of symbols, the vast majority are comprised of common words such as for, if, switch, extend, and abstract. When only dealing with the common word-based programming languages, should they not be considered real languages since they are derived from English? Scott D. Anderson, a computer science professor at Spelman College, says, “Programming is part engineering and part communication.” He continues to relate code to writing by saying that functions and white-space (indentation and spacing) contained in source code have respective written equivalents: paragraphs and punctuation (Anderson). Not only does the programming language contain real words, it also includes similar ordering structures.

In contrast, Ellen Ullman, “an English major turned programmer turned writer,” (Bugged Out) notes the following in an interview about her first book, “So if you ask me, it's not a language. We can use English to invent poetry, to try to express things that are very hard to express. In programming you really can't” (Ellen Ullman Elegance & Entropy). But the problem with this statement is that she is arguing over the extent a programming language can be expressive, which is above the issue whether it is a language or not. Even the esoteric symbolic languages listed above seem to provide, “A system of signs, symbols, gestures, or rules used in communicating” (American Heritage), considering the communication is directed toward the computer. Years later in an interview about her latest novel The Bug, Ullman seems to change her mind and says, “Computers use languages: very impoverished and artificial languages, but languages nonetheless” (What's Bugging Ellen Ullman).

After establishing that programming languages are languages it is also the case that programming is writing, at least at its simplest level defined above. This is true since programming consists of typing, which is equivalent to writing, some programming language, which is language consisting of symbols and words.

Next to consider is programming in relation to literature, which can be broken down into several smaller questions. The first is: is programming creative? Since the main difference between a programming language and a spoken language is the number of words (referred to as keywords in programming terminology), it seems best to ask if the reduced vocabulary has any detrimental effects on creative expression. In a scripted dialog on writing as programming as writing, Stephen Ramsay says, “a constrained language isn't less communicative by virtue of being constrained. If anything, a constrained language has the potentiality to be more communicative” (Ramsey and Rockwell). The concept of language constraint is now new. The Oulipo, a philosophical literary group from the 1900's often wrote when under various constraints such as the inability to use a specific letter (Lipogram). The Oulipo embraced constraint since they believed it promoted creativity rather than limited it. Perl programmers are familiar with idea as TMTOWTDI, which is the Perl language motto “There's More Than One Way To Do It” (Wall 18). It certainly seems that even with a limited vocabulary a programmer is still afforded much creativity.

Another closely related question to the comparison of programming and literature is: is programming artistic? This is a difficult question to answer since art can mean many different things. Without delving into theory, art will be considered creative work that pertains to beauty and is an end to itself, not a means to an end. Although most artists are not associated with science and technology, there are a significant number of modern artists who create artwork from digital images as well as artists who create sensory computer programs, which are artwork. But even though a computer program is a piece of artwork, the act of programming it was not necessarily an artistic experience. The question: is programming artistic, deals with source code and whether the source code itself is artwork and not the produced program.

In Software Development, David Zokaities considers the question by thinking about reading code, “Now that's a remarkable way to approach software- not to debug, analyze, program, or develop, but simply to read. The act of reading allows me to approach my code as a work of software art: I strive to make the overall design, algorithm, structure, documentation and style as simple, elegant, through and effective as practical” (qtd in Literate Programming Quotes). The computer program may not be able to easily portray aesthetical beauty in the typical manner, but there is some sense of beauty and elegance in reference to the quality of code. Mark Wallace details programming elegance by saying, “Elegance takes in such factors as readability, modular coding techniques and the ease with which a program can be adapted to other functions or expanded to perform additional tasks” (qtd. in Literate Programming Quotes). A beautiful program goes beyond just performing its task well, but is also written in a manner which is both elegant and practical.

This leaves the question of programming being an end in itself. Can programming can be done just for programming's sake just as art can be done only for art's sake? It is hard to consider the utility of programming beyond creating a usable computer program. Dr. Edsger W. Dijkstra, a prominent historical figure in Computer Science, says the following in his opening to Discipline of Programming, “My original idea was to publish a number of beautiful algorithms in such a way that the reader could appreciate their beauty” (A Discipline of Programming). This seems to indicate that it is possible for programming to useful in of itself, but it is doubtful that even a small fraction of programmers in the world consider his or her work beyond the final compiled executable.

The final question to consider in reference to programming and literature is: is programming expressive? Programming may be creative and artistic, but can a programmer express themselves as an author does in literature? There is a notion of styles in programming but it falls short in comparison to the rich styles in literature. Ellen Ullman agrees that programmers have styles but notes that a programming style can only, “tell what kind of programmer they were, but not what type of person they were. Code is not expressive in that way. It doesn't allow for enough variation. It must conform to very strict rules” (Elegance & Entropy).

The problem with expression in programming languages is that the nature by which words are understood is greatly different than natural language. Rockwell expresses this in his response to Ramsay's earlier note on creativity, “Whether code is meant for humans to interpret (as in a secret code) or computers, there is a code book or set of rules for the substitution of code words/numbers/groups with either plain text that is humanly readable or machine instructions that can control a machine. Text is not made up of units that are expected to be substituted for something” (Ramsey and Rockwell). The distinct difference here is that a computer understands a word or combination of words uniquely as direct representation of machine commands, but words in natural language cannot be simply substituted for one specific meaning.

* * *

To this point an effective argument on the literary qualities of programming has been made, but still programming seems to fall short of being literary. Programming is a form of writing and one can argue that programming has creative and artistic elements, but programming appears to lack the ability for true expression and lack the significance of being and end in itself.

However, the discussion does not end here. Just because code is not literary in of itself does not exclude the possibility of specific subsets of code to achieve literary status. Earlier this year I made the following comment:

I also have trouble with his [Aarseth] comparison of program source code [to] something of a rhetorical sense. I agree that the code is more than just “complex lists of formal instructions” and can also be characterized by similar notions of quality, elegance, and so forth, but in the end the source code is just the means of creating some useful program in executable form. The qualities listed above do have importance in understanding and improving the program, but once the goal of the source is attained (the actual program in binary form) the source doesn't have any value to the program's user, and only possible future value to the developer him/herself. (Finley)

Ellen Ullman takes a similar view point, “a computer program has only one meaning: what it does. It isn't a text for an academic to read. Its entire meaning is its function” (Elegance & Entropy). The problem with these statements is that the mindset – the computer is the only audience of the source code – is rather limited. We could not see beyond our personal coding experiences to realize that there can be another form of programming which goes beyond our viewpoint.

The prime example of what goes beyond the traditional paradigm of programming for the computer is “Literate programming”. Dr. Donald E. Knuth, who is noted by some to be the father of computer science, says the following in his introduction to Literate Programming, “Let us change our traditional attitude to the construction of programs: instead of imaging that our main task is to instruct a computer what to do, let us concentrate rather in explaining to human beings what we want a computer to do” (99). Knuth is describing a radically different view of programming. He is not only saying that source code has two audiences, both the computer and other programmers, but is making the primary focus of programming communication to other programmers and making computer instruction merely secondary.

Before discussing the details of Literate programming, the concept dual audiences for source code will be discussed on a simpler level. One aspect of programmer readability common in programming languages is source code comments. Comments are notes the programmer writes interspersed in the source code and are used to help explain what the code is doing. During compilation comments are totally ignored by the compiler and have no effect on the created executable.

In the earlier discussion of programming languages, source code comments were not addressed since they are not a part of the computer's interpretation of the source code. It is only when one considers that the source code has two audiences that comments become relevant. One could continue the programming as literature argument utilizing the idea that comments improve the expression of the source code for human audiences, but there is a problem with this. The problem is that comments do not necessarily blend seamlessly with the code. They are more of an afterthought than part of the code itself. In a book on programming practices, Henry Ledgard says to, “Avoid embedded (in-line) comments within the body of the module itself. It is my view that such comments can readily intrude upon the meaning of a program” (qtd. in Literate Programming Quotes). When someone reads source code they are essentially jumping perspectives when reading comments and code. The reader is not reading a seemless and integrated dialog but two distinctly different ones, which cannot merge to a unifying literary piece.

Literate programming surpasses the literary quality of source code with comments since the primary focus is communication to other humans, not machines. Ross Williams, the creator of the Literate programming tool FunnelWeb, concisely describes this contrast:

A traditional computer program consists of a text file containing program code. Scattered in amongst the program code are comments which describe the various parts of the code.

In literate programming the emphasis is reversed. Instead of writing code containing documentation, the literate programmer writes documentation containing code. No longer does the English commentary injected into a program have to be hidden in comment delimiters at the top of the file, or under procedure headings, or at the end of lines. Instead, it is wrenched into the daylight and made the main focus. The "program" then becomes primarily a document directed at humans, with the code being herded between "code delimiters" from where it can be extracted and shuffled out sideways to the language system by literate programming tools. (qtd. in Literate Programming Quotes)

A program written using the Literate programming methodology has taken on an entirely new form. Not only has the source code primarily changed to documentation, it has become a textual document. In fact, the output of Knuth's Literate programming tool, WEB, is a completely typeset book. This book narrates the desired computational tasks to the reader using the expressiveness of natural language in harmony with coded programming language.

Literate programming also changes the emphasis from the executable program to the source document itself. Normal source code is merely a means to produce a computer program, but the Literate programming source document is an end in itself. Now, “We have seen that computer programming is an art, because it applies accumulated knowledge to the world, because it required skill and ingenuity, and especially because it produces object of beauty” (Knuth 14).

Even though programming is creative and artistic, it cannot be compared to literature since it does not allow full expression and is merely some means to create a program rather than an end in itself. However, Literate programming surpasses programming's literary insufficiencies and can produce works of literature. Furthermore, it is particularly interesting to consider the combination of the open source software movement and Literate programming.

Wikipedia describes the open source movement as, “a large movement of programmers and other computer users that advocates unrestricted access to the source code of software.” The open source movement consists of millions of developers across the globe, who are working together under the banner of freely distributable source code to create quality software. What would happen if open source programmers were to embrace Literate programming? It is possible that an entirely new literary genre could be born. It could even grow to be a vast resource where programmers could read books instead of trudging through hard to read source code, dramatically improving the ease of learning and sharing of the latest software technologies. It could additionally be a resource which helps break down the barrier between programmers and non-programmers by allowing simpler and more understandable access to the current works of developers. Donald Knuth joked about this future saying, “I'm hoping someday that the Pulitzer Prize committee will agree,” and award prizes for the “best-written program” (qtd. in Literate Programming Quotes). It is a long shot, but nothing is impossible. It may come to pass.

Works Cited

A Discipline of Programming. Amazon.com. 8 May 2004. <http://www.amazon.com/exec/obidos/tg/detail/-/013215871X/103-7265772-9487056>

The American Heritage® Dictionary of the English Language,
Fourth Edition. 6 May 2004. <http://dictionary.reference.com/>.

Anderson, Scott D. C++ Programming Style. 20 July 1998. Spelman College. 6 May 2004.
<http://www.spelman.edu/~anderson/teaching/resources/style/>.

Finley Timothy. Labyrinths (Ergodic Literature). 9 February 2004. <http://www.otal.umd.edu/~mgk/courses/spring2004/467/archives/000271.php#605>

Knuth, Donald E. Literate Programming. Center for the Study of Language and Information, 1992.

Literate Programming Quotes. February 2004. 6 May 2004. <http://www.literateprogramming.com/index.html>.

"Open source." Wikipedia. 9 May 2004.<http://en.wikipedia.org/wiki/Open_source>.

Ramsay Stephen and Rockwell Geoffrey. Untitled Number 4: A Brechto-Socratic Dialogue. 7 May 2004. <http://strange.mcmaster.ca/~grockwel/weblog/notes/u4.3.pdf>

Two Cultures Or One? 13 May 2003. Bryn Mawr College. 7 May 2004.
<http://serendip.brynmawr.edu/sci_cult/TwoCultures.html>.

Ullman, Ellen. Interview with Scott Rosenberg. Bugged out. 16 May 2003. 6
May 2004. <http://www.salon.com/books/int/2003/05/16/ullman/index_np.html>.

Ullman, Ellen. Interview with Scott Rosenberg. Elegance & Entropy. 9 Oct.
1997. 7 May 2004. <http://archive.salon.com/21st/feature/1997/10/09interview.html>.

Ullman, Ellen. Interview with ACM Ubiquity. What's Bugging Ellen Ullman?
7 May 2004. <http://www.acm.org/ubiquity/interviews/e_ullman_1.html>.

Wall, Larry et all. Programming Perl 3rd Edition. Sebastopol: O'Reilly & Associates, 2000.

Webster's Revised Unabridged Dictionary. 7 May 2004.

<http://dictionary.reference.com/>.

WordNet 2.0. 7 May 2004.
<http://www.cogsci.princeton.edu/~wn/>.

Finley 12

2004-05-07T21:38:32