Live data from Hacker News

Code is not Literature

gigamonkeys.com

51–60 of 88 posts

Re: Code is not Literature

#51
post #20

I would be interested to know what the OP thinks about stepping through code as opposed to reading it. To me, reading code and stepping through it in a debugger are two complimentary ways of understanding it. I call those the static and the dynamic way of viewing code.

Interesting. Does something exist where I can visually trace through how my javascript code is being executed? It would be wonderful to have a visual representation.

Re: Code is not Literature

#52

I think the author has a somewhat limited definition of “literature”, though he ultimately comes to the right conclusion that code must be “studied”, not “read”. It’s true, code is typically less linear than a pulp novel, but other types of literature are also involved, with layered meanings, which must be examined carefully, with reference material handy, and lots of flipping back and forth between sections. For ins…

Have you ever had a reason to read just part of a book? Pages 236-241 of Moby Dick, with no intention to ever read the rest? That seems to be a crucial difference between the two activities.

[deleted]

Re: Code is not Literature

#54

I think the author has a somewhat limited definition of “literature”, though he ultimately comes to the right conclusion that code must be “studied”, not “read”. It’s true, code is typically less linear than a pulp novel, but other types of literature are also involved, with layered meanings, which must be examined carefully, with reference material handy, and lots of flipping back and forth between sections. For ins…

Have you ever had a reason to read just part of a book? Pages 236-241 of Moby Dick, with no intention to ever read the rest? That seems to be a crucial difference between the two activities.

Moby Dick is probably a poor example. Something like the Iliad or the Bible might be appropriate since extensive studies often focus on a few chapters or verses. Yes, one normally reads the entirety of the work, but studying specific parts seems more apropos.

Re: Code is not Literature

#55
post #39
post #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 th…

Yes I agree. But, for myself, even (or especially) with a purpose I mind, I decode , not read per se. I've recently been working through the selfoss source and adding some new features, and this is the tack I've taken through it -- decode the source to find where the feature should be added. So I agree with you, and the OP.

True, but that's just a question of density. There are books written in English that are so dense that they too need to be decoded.

Re: Code is not Literature

#56

I think the author has a somewhat limited definition of “literature”, though he ultimately comes to the right conclusion that code must be “studied”, not “read”. It’s true, code is typically less linear than a pulp novel, but other types of literature are also involved, with layered meanings, which must be examined carefully, with reference material handy, and lots of flipping back and forth between sections. For ins…

Have you ever had a reason to read just part of a book? Pages 236-241 of Moby Dick, with no intention to ever read the rest? That seems to be a crucial difference between the two activities.

> Have you ever had a reason to read just part of a book?

Of course I have. Any time I've picked up a reference book, textbook, or anthology.

books != novels

Re: Code is not Literature

#57
Of course, the whole point of "literate programming" is to provide hints and structure for the human reader. This is done not by creating some structure in the code that makes sense to the compiler and a human, but by breaking up a program into pieces that are put together later.

I feel that this is really nothing that a good compiler couldn't do with a higher level language today. However, in doing so I would wind up with a heavily polluted namespace of helper methods and such that really don't help me understand what I was trying to do.

So, in the vein of reading code. I've only read a few sections of "The Stanford Graphbase," as I just got it a couple of weeks ago, but I can already tell this would have been a much better introduction to a few graph algorithms than I had in my undergrad.

Further, all of the "literate" programs I have written have been much easier for me to jump back into. Precisely because I have much of my "decoding" notes. So, code isn't literature, because we don't write it with a narrative for humans in mind. But, there is no real reason we couldn't.

Re: Code is not Literature

#59
post #51
post #20

I would be interested to know what the OP thinks about stepping through code as opposed to reading it. To me, reading code and stepping through it in a debugger are two complimentary ways of understanding it. I call those the static and the dynamic way of viewing code.

Interesting. Does something exist where I can visually trace through how my javascript code is being executed? It would be wonderful to have a visual representation.

Most browsers have a "Development Tools" option that provides a number of tools including a step-through debugger similar to those in XCode/Eclipse/Visual Studio.

I personally use the development tools in Safari most of the time.

Re: Code is not Literature

#60
post #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 th…

Agreed. It's more like dense technical writing than literature.

That doesn't mean that reading it is any less important, or that writing readable code is any less important, or that code is all an ugly mess not worth reading.

It may mean that the reading pattern for code might not lend itself toward a reading group in the same way that literature does. So we might need to either spend more time reading code in solitude or develop new ways to do reading groups that work for this style of writing.

And it just seems plain ridiculous to say that people don't spend time reading code. People do read code, but they don't think about it as "reading" in the same way as someone reads a book, so they don't have it readily at hand when asked.

Post reply on HN