11 min.

The Literary Medium of Source Code

  • programming
  • opinion

In modern society, there are many forms of new media ranging from blog posts to text messages, to tweets — the list goes on. Although it is up for debate which of these forms may exist as literature (Armistead, 2014), beneath many of these new mediums, wrought by the advancement of technology, exists an unseen literary landscape as a common thread in all of them: source code. Source code is a broad term meaning “a text listing of commands to be compiled or assembled into an executable computer program.” (“Source code”). The primary purpose of source code is to provide a means for humans to give detailed, complex instructions to a computer. In our society, source code plays a major role in most of our daily lives. People interact with source code, whether there are aware of it or not, on a daily basis through the use of any electronic device. In a society impacted by such prominent cultural shift towards technology — and by extension, a reliance on source code — the effects of this new form of expression must be considered by the artistic community as a form of artistic expression itself in order to adequately represent technology’s impact on social change.

Through a comparison of source code with other forms of traditional artistic expression (art forms which are already established in their own right) and analyzing the social context in which source code exists, conclusions can be drawn about the state of source code as a legitimate medium for artistic expression in a digital society. In this analysis, there are several factors to be considered: relevance of the form to the society in which it exists, the ability for people of the society to understand and interpret the form, and how the form delineates from, and relates to, those forms already established in the society.

A Comparison with Traditional Forms

Computer art has established itself as a way for artists to stay relevant in a digital society (Kera, 2010). Source code, on the other hand, does not exist in the same scope as digital art. Source code leans more towards literary study as it combines language, syntax, and structure rather than focusing on visual appeal exhibited by other forms of digital art.

Source code, in many ways, holds a mirror to traditional verse and poetry. In poetry, there exists some form — even if negligible in some cases — of structure, format, syntax, and punctuation. In source code, the same holds true. Take the form of a sonnet, for example. Every sonnet must have the following structure: 14 lines with a rhyme scheme of ABABCDCDEFEFGG. The format, however, can differ in terms of breaking the stanzas into groups of eight and six lines, or perhaps three stanzas of four lines and a single stanza for the finishing couplet. Also, lines can be indented or outdented in various ways. These types of formatting are known as whitespace which can sometimes impact the meaning of a work. In comparison, every Java method (function) must have the following structure: An identifier (name) with a return type (what the result of the method is), an argument list (parameters fed into the method), and body (the operations performed in the method). As with poetry, the formatting of a method can differ greatly. Code can be separated into blocks (stanzas), and also indented and outdented, just as poetry. In most programming languages, Java, PHP, C, to name a few, whitespace has little or no effect on how the program runs; they could essentially be written all on one line. However, with many new languages such as Python, Jade, and SASS, whitespace is crucial to how the program operates and can affect the meaning of the source code. Again just as in poetry, which follows grammar rules of the English language, programming languages also have their own grammar which must be followed.

Although it is decidable that programming languages exhibit traits of traditional forms of literature, poetry, in particular, this does not mean that source code is merely a branch of traditional poetry. There are equally many traits that make it a unique medium.

When discussing audiences, computers must be considered as readers, just as much as humans. The question must be addressed: Is the author addressing a human or a machine? Furthermore, is the speaker a human or a machine? In the poem “Black Perl” by Larry Wall (see Appendix A), which is written in the programming language Perl, the program runs and produces no errors, yet it quits on the very first line at the command “exit”. From a human analysis, this is meaningless. From a computer’s analysis: the rest of the poem is nonexistent. One analysis of the poem could interpret this as meaning that from the moment we are born, we are already dead. It could equally be concluded since the program produces no output, that it could be a metaphor for miscommunication.

It is, therefore, a necessity to consider not only the text, but the output of the program, and the meaning of words, not as English words, but as commands in the context of the programming language.

Social Acceptance of Literature

As demonstrated above, programming languages can be analyzed in a literary context, just as other types of literature, but they can also inhabit dimensions that are unique to the medium. This fact, convincing it may be, still does not concretely establish source code as a medium. A resemblance to literature is not enough to establish source code as literature with merit in a society. As stated by Ohmann (1978): “Each society chooses by some means those new works it holds to have merit.” (p. 89). A society must accept and embrace source code as artistry or social commentary in order for it to enter the realm of literary study. In current times, there does not exist the widespread community support needed for source code to be socially accepted as a form of literature. With only 2.4% of people attending college in the United States pursuing a degree in computer science (“The job/student gap in computer science”), our society is not sufficiently literate in source code which, as explained below, greatly influences what is considered literature in a society. This is not surprising since source code has only been in existence for a few decades. However, in recent years the emergence of the information and communication technologies has prompted a socioeconomic change in which 60% of STEM jobs are in computer science and software development (“The job/student gap in computer science”). This is an intriguing shift in our world and it will likely influence the state of source code as an artistic medium. As more people learn how to code, people will become increasingly fluent and literate in programming languages. Thus giving works written in these language more social power and influence, following E.D. Hirsch’s (1978) statement about the power of language: “The language in which [a literary work] is written may […] lose its power of manifesting literary qualities, until such time as readers can be trained to decipher or translate it so to restore this power.” (p. 57). If we are to believe Hirsch’s assessment of the impact of language on the ability for a work to hold literary qualities, then the natural progression of our world towards digital societies means that works written in programming languages may eventually rise to a place of literary merit as the population becomes ever more literate with source code.

Non-literary Texts as Literature

The scope of literary study changes over time to fit the social constructs of a society (McFadden, 1978). Even today, in certain social circles, these constructs are already built around source code. Developer communities collaborate and communicate amongst each other and are, for the most part, fluent in one or more programming languages. According to Hirsch (1978): “A body of work is selected because it helps a community define itself.” (p. 50). Thus, it follows that a work selected by a community of computer scientists may include a computer program. Sure enough, a common piece of work in the computer science community is “HelloWorld” which when executed, displays the phrase “Hello World!” (or some variation thereof) to the user. This work has many forms (see Appendix B), spanning across almost all programming languages and is arguably the most basic form of expression in computer science. It has its origins in the C programming language and was originally written by Brian Kernaghan at Bell Laboratories in 1974. One might (rightfully) argue that “HelloWorld” was never intended to be a work of literature. However, this does not discount it as a literary work as some literary works are not always originally intended as literature. “Texts which originally had their primary purpose a non-literary function [have come] to be taken as essential literary works in the course of time.” (Altieri, 1978, pp. 62-63). “HelloWorld” is by that respect, a work which was not originally literature, but which came to define the computer science community. It should also be recognized that “HelloWorld” is different from the one used above with “Black Perl”. “Black Perl” was a work that was fully intended to be a poem, whereas “HelloWorld” was meant to have only a functional purpose.

A snow shovel hanging from from the ceiling by a wire

A comparison with another form of fine art supports this view as well. In the age of Dadaism, Marcel Duchamp shattered the boundaries of the art community with his concept of the readymade, which is nothing more than a consumer product displayed as a work of art. Arguably, the most famous example of a Duchamp readymade is called “In Advance of the Broken Arm”. This piece is a simple snow shovel that Duchamp purchased at his local hardware store and yet it has been critically analyzed and praised as artistry. In the context of source code, Duchamp’s concept of a readymade can be applied to “HelloWorld” which, like the snow shovel, was originally intended to serve a functional purpose, and was never intended to be art. Furthermore, there are many versions of “HelloWorld” just as there are many versions of Duchamp’s “In Advance of the Broken Arm”. In fact, Duchamp replaced the snow shovel of the piece four times in its history, which is similar to “HelloWorld” being written in various programming languages. The representation of the piece is variably different, but the concept and meaning are not drastically altered. (“In Advance of the Broken Arm”)

Literature by Association

Hirsch proposed the interesting notion of “literature by association.” If an author is a prominent literary figure in a society, then their entire body of work including anything from a novel to a grocery list is by definition a work of literature. One of the examples used by Hirsch is William Wordsworth, stating that Wordsworth’s body of work is canonical in literature, which includes non-literary works by Wordsworth such as his travel book on the Lake Country. (Hirsch, 1978)

So by that measure, if for example, a poet like Wordsworth had written a computer program, it would by definition be a literary work as well. This hypothetical has yet to be proven since, to our knowledge, no prominent literary figure has written a computer program, but what can be concluded is that there is a growing possibility for this to happen as programming grows in popularity and the need to represent programming as part of culture will eventually demand experimentation with the medium of source code in the artistic community.

As for existing works in the medium intended as literature, such as “Black Perl”: it will likely never reach the status of literature due to the declining popularity of Perl as a programming language (Krill, 2014). Similar to works written in other dead languages works written in Perl will struggle to stay relevant as its readership diminishes. Readers must be able to understand the language of a work in order for it to have literary merit in a society (McFadden, 1978, p. 56). Furthermore, Hirsch (1978) argues that a language with an insignificant readership cannot produce works that have literary qualities.


Source code is a diverse literary medium offering unique forms of expression which sets it apart from existing form of literature. It can be analyzed from multiple perspectives and have both abstract and concrete meaning, as demonstrated with “Black Perl” and “HelloWorld”.

Nonetheless, in the context of our current social landscape, source code is not literature. Still despite that, the scope of literary study is only constricted by the society which defines it (Hirsch, 1978). With a worldwide progression towards digital societies, new works that utilize source code as a medium are increasingly likely to become the subject of literary study. As a result of this, the definition of literature has the potential to change with society to include works in source code as canon in the field of literature.


Altieri, C. (1978). A Procedural Definition of Literature. In P. Hernadi (Ed.), What is Literature? (pp. 62-78). Bloomington: Indiana University Press.

Armistead, C. (2014, January 10). Has Twitter given birth to a new literary genre? The Guardian. Retrieved from http://www.theguardian.com/books/booksblog/2014/jan/10/twitter-birth-new-literary-genre

Ghosh, R. (2015, April 24). Re: Why are plays considered to be literature, but film scripts are not? Quora. Retrieved June 18, 2015, from http://www.quora.com/Why-are-plays-considered-to-be-literature-but-film-scripts-are-not

Hirsch, E.D. (1978). What Isn’t Literature? In P. Hernadi (Ed.), What is Literature? (pp. 24-34). Bloomington: Indiana University Press.

In Advance of the Broken Arm. (n.d.). Retrieved June 22, 2015, from: http://www.toutfait.com/unmaking_the_museum/Shovel.html

Kera, D. (2010). From data realism to dada aggregations: visualizations in digital art, humanities and popular culture. National University of Singapore. Retrieved from http://www.academia.edu/2397351/From_Data_Realism_to_Dada_Aggregations VisualizationsinDigitalArtHumanitiesandPopularCulture

Kernighan, B. (1974). Programming in C: A Tutorial. Murray Hill: Bell Laboratories.

Krill, P. (2014, April 11). Perl language’s popularity hits all-time low. InfoWorld. Retrieved from http://www.infoworld.com/article/2607775/perl/perl-language-s-popularity-hits-all-time-low.html

McFadden, G. (1978). “Literature”: A Many-Sided Process. In P. Hernadi (Ed.), What is Literature? (pp. 49-61). Bloomington: Indiana University Press.

Ohmann, R. (1978). The Social Definition of Literature. In P. Hernadi (Ed.), What is Literature? (pp. 89-101). Bloomington: Indiana University Press.

Source code [Def. 1]. (n.d.). Oxford Dictionaries. In Oxford Dictionaries. Retrieved June 18, 2015, from http://www.oxforddictionaries.com/definition/american_english/source-code

The job/student gap in computer science. Code.org. Retrieved June 18, 2015, from: https://code.org/promote Wall, L. (1990). Black Perl. Usenet.

Appendix A: “Black Perl” by Larry Wall

BEFOREHAND: close door, each window & exit; wait until time.
    open spellbook, study, read (scan, select, tell us);
write it, print the hex while each watches,
    reverse its length, write again;
    kill spiders, pop them, chop, split, kill them.
        unlink arms, shift, wait & listen (listening, wait),
sort the flock (then, warn the "goats" & kill the "sheep");
    kill them, dump qualms, shift moralities,
    values aside, each one;
        die sheep! die to reverse the system
        you accept (reject, respect);
next step,
    kill the next sacrifice, each sacrifice,
    wait, redo ritual until "all the spirits are pleased";
    do it ("as they say").
do it(*everyone***must***participate***in***forbidden**s*e*x*).
return last victim; package body;
    exit crypt (time, times & "half a time") & close it,
    select (quickly) & warn your next victim;
AFTERWORDS: tell nobody.
    wait, wait until time;
    wait until next year, next decade;
        sleep, sleep, die yourself,
        die at last

# Larry Wall

Appendix B: “HelloWorld” in Various Languages

“HelloWorld.c” by Brian Kernighan (C)

#include <stdio.h>
main( ) {
  printf("hello, world");
  return 0;

“HelloWorld.java” (Java)

class HelloWorld {
  public static void main(String[] args) {
    System.out.println("Hello World!");

“helloWorld.html” (HTML)

<!DOCTYPE html>
    <p>Hello World!</p>

“helloWorld.pl” (Perl)

print "Hello World!\n";

“helloWorld.php” (PHP)

	echo "Hello World!";

More Posts

(c) 2020, David Leger