Live data from Hacker News

Code is not Literature

gigamonkeys.com

1–10 of 88 posts

Re: Code is not Literature

#3
I think code is sort of a combination of literature, ToDO and shopping lists, and directions to somebody's house, written from your own perspective. There are recurring themes and characters, but it can get lost in a sea of detail.

Re: Code is not Literature

#4
Having just implemented a specification where the spec was less useful than some source, I'd say that literature is not code for sure. And as someone who has read literature, though I wasn't an english major like the author--you know it seems like they encourage english majors to treat writing as a specimen--it seems true that code is not literature either, it doesn't even compare for entertainment value for example.

Re: Code is not Literature

#5
Why do we still embed natural language descriptions of source code (i.e., the reason why a line of code was written) within the source code to the exclusion of intrinsically linked separate documents?

http://i.stack.imgur.com/JlUiE.png

The potential advantages include:

- More source code and more documentation on the screen(s) at once

- Ability to edit documentation independently of source code (regardless of language?)

- Write documentation and source code in parallel without merge conflicts

- Real-time hyperlinked documentation with superior text formatting

- Quasi-real-time machine translation into different natural languages

- Every line of code can be clearly linked to a task, business requirement, etc.

- Documentation could automatically timestamp when each line of code was written (metrics)

- Dynamic inclusion of architecture diagrams, images to explain relations, call-graph hierarchies, etc.

- Single-source documentation (e.g., tag code snippets for user inclusion in manual[s]).

Re: Code is not Literature

#6
Code can be literature in specific cases, such as the Shakespeare programming language. It's just a whimsical, esoteric language, like lolcode, but it reads like the Immortal Bard himself was an early adopter of learning to program.

Example of a conditional statement:

  Juliet:
    Am I better than you?

  Hamlet:
    If so, let us proceed to scene III.
http://en.wikipedia.org/wiki/Shakespeare_(programming_langua...

Re: Code is not Literature

#7
Asking people what they've read "just for the heck of it" is the wrong question, because code is not linear, so it's extremely ungainly to read without purpose.

But as soon as the skilled code reader has a purpose in mind -- a question to answer -- he or she can rapidly find a meaningful narrative. Put into that context, programmers read code constantly, and the more they read the better they get.

So I don't like the "nobody actually reads code" claim. It's a strawman. When I tell people to read code, it's always in the context of "pick something you want to understand or fix, and read with that purpose in mind." Not "the Linux kernel is like Moby Dick, you should really read it all."

Re: Code is not Literature

#8
>It was just basically the way you solve some kind of an unknown puzzle—make tables and charts and get a little more information here and make a hypothesis. In general when I’m reading a technical paper, it’s the same challenge. I’m trying to get into the author’s mind, trying to figure out what the concept is. The more you learn to read other people’s stuff, the more able you are to invent your own in the future, it seems to me.

I really enjoyed reading this article, but I would argue with its headline. Based on the author's experience and the example from Donald Knuth, it seems like the best way to read code is to go through it multiple times to the point where you could reimplement it or provide complete documentation for it.

The literary analog for code reading might be a writing a scholarly reader's companion to a book.

You can't write a secondary source for a work of literature by reading it once through like a drugstore thriller or romance. A literary analyst would read the book through completely >3 times and spend hours on certain key passages. They would take extensive notes reconstructing the innerworkings of the characters, the relationships between them, and key themes. Once the work has been comprehensively understood, the scholar can write out in an expository manner what is going on in the piece of literature, the same way that a thoroughly digested piece of software can be rewritten based on the mental model that develops as you read.

Obviously software and novels do not map completely one onto the other. I think the key similarity is that they both can be created with sufficient complexity to require taking multiple passes and following along with the author, building something similar yourself in order to truly understand them.

Re: Code is not Literature

#9
I agree with the author that code may not be literature. Taken from the opposite line of reasoning there have been movements in the past to make literature more like code. Specifically I thinking of Oulipo (which included Calvino as probably the most famous) on bringing new structures to literature including some generative ones which could be thought of as programming or combinatorics.

http://en.wikipedia.org/wiki/Oulipo

Re: Code is not Literature

#10

Having just implemented a specification where the spec was less useful than some source, I'd say that literature is not code for sure. And as someone who has read literature, though I wasn't an english major like the author--you know it seems like they encourage english majors to treat writing as a specimen--it seems true that code is not literature either, it doesn't even compare for entertainment value for example.

That's an interesting point, that literature can also be approached as a dissection. But I think that Mr. Seibel's observation still holds. Literature is primarily intended to be read and discussed, while code is primarily intended to perform a job. One lends itself to an experiential conversation and the other very contextual explaination.
Post reply on HN