I’ve always liked writing. And sometimes I see myself comparing the act of writing literature with that one of writing code. Is that comparison fair? Is it one really that different from the other?
Types of audiences
If someone is going to read you at all, in the case of literature your reader is going to be human. On the other hand, in coding -which could be simply defined as writing software– both humans and computers may read your code. So we’ve found there our first difference:
whether he likes it or not, a coder is also a writer; however, a writer isn't necessarily a coder.
But is that really true? You could argue that the writer must also follow grammatical rules in order to, at least, be understood by other humans (those that understand the language, that is). So, in that way, a writer could also be regarded as a coder.
By the same token then, the coder would not only be a writer/coder for the humans but also a coder for the humans/computer. So programming, in this light, could be perceived as something more difficult than writing.
Requirements
One other noticeable difference is that in coding, there is usually a set of functional requirements, usually very concrete and listable, that the coder has not previously set on his own: there is an external need of some functionality that must become real.
In writing, though, this is more anarchical in that you usually have to imagine the plot, characters, etc: in literature the creativity not only lies in developing the plot set by an external requirement but also in the creation of the “requirements” themselves. There are even people that writes without requirements, just letting it flow out, something unimaginable in coding.
It works
Probably, the biggest difference between the two, writing and coding, is not in the activity itself, but in the act of analyzing the results of it: the concept of, I’ll call it, ‘it works’. In code, there’s always a functionality involved, a time when you can say that it works: when it complies with the functional requirements. However, in literature, since there aren’t functional requirements, there isn’t a clear boundary of when a work of art works, since that usually depends more on the subjectivity of the reader than on a measurable objectivity.
Authorness
Usually, writing is an activity that one does all by himself, always starting from a blank page, being the one and only responsible for the result’s virtues and faults. This is,
In literature, the concept of authorness is, most often, related to a single person*.
*let me contradict myself: one of the books I’m reading at the moment, Good Omens, was co-authored by Neil Gaiman and Terry Pratchett.
However, in programming, the concept of authorness is usually shared by a lot of people.
Even this is usually true, we could distinguish between two types of coding:
- when you have to write some method/function/whatever from scratch;
- maintainance/evolutive tasks, in which you have to fix/extend something already written/coded.
Can you imagine this conversation:
-hey, here you have this copy of Crime and Punishment; you see, chapter 11 is not working: fix it! -What about Dostoyevski? -Who? Oh, yeah, wasn't he the guy who did the first commits of the Crime and punishment project?
It ain’t over till it’s over
Following this last surrealistic train of thought, a literature work of art would never be finished, being impossible to accurately say what Juan Ramón Jiménez wrote in a beautiful poem:
This beautiful verse, applied to coding, would be unthinkable: in software development, it’s well known that the only permanent thing is change.
‘Cause baby, it ain’t over till it’s over
Lenny Kravitz
Intimate moments
So we could say writing is a “private” activity. It’s true that you may show your work to some people, like editors and the such, in order to improve it: adding some parts here, deleting some other parts there…; but, at the end of the day, every line is yours. And once you publish it, that’s it: for better or worse there usually aren’t any more versions of it.
On the contrary, coding is more of a social activity. Hardly ever you do a project completely on your own. Even if you do that, I bet at least in some places you will be using third-party libraries.
Style
But, still, even if coding is easier in that you aren’t always starting from scratch, it has a difficulty that you don’t encounter in writing because, in coding, there is a shared style that you must find, catch and follow, in order not to disrupt the conventions/readability/story that the code is telling. In writing, you are free to do whatever you feel like (as long as you get along with yourself and follow your own conventions, that is).
All work and no play makes Jack a dull boy
Recently, I finished reading Stephen King’s The shining. I had already watched Stanley Kubrick’s adaptation of the novel a long time ago. After closing the book, I discovered that I couldn’t recall in the book that scene included in the movie in which Wendy finds and reads what his husband Jack has been writing over and over in his madness (in the English version, all work and no play makes Jack a dull boy).
That made me think that, in reality, no matter how great a work of art is, everything is improvable. Don’t get me wrong here: I’m not saying that Kubrick’s work was better than King’s: I’m just saying I would have loved to see that scene in the book. And I’m also saying that if Kubrick had followed by the letter King’s plot, we would have missed one of the greatest scenes in the history of cinema. Curiously enough, it seems that there were some bickering about the quality of both works seen through the other’s perspective.
Twice upon a time
Once a work of art (and here of course I include software code as a work of art) has been released, the coders have a great advantage over the writers: software projects are always opened for improvements. So take advantage of it! Don’t let your ego stand between “your” code and a better code.
To sum up, don’t be a dull boy: work and play, play and work. And, since I love both writing and coding, wouldn’t it be cool that
the more you write the better you code; the more you code, the better you write
were true?