4 ms·
I still think it's literature, just that most of it is trash literature. But then again, I was an English major and was trained on how to dissect literature. I
by dimal 3y ago
I still think it's literature, just that most of it is trash literature. But then again, I was an English major and was trained on how to dissect literature. I realized a while ago that there was a book and a method I learned in English Lit 101 that I think informed how I read code. It's called The Critic's Hornbook, by William Dowling [0]. In short, it's a methodology for meticulously breaking down the meaning of every word, phrase and reference in a text, without resorting to any subjective interpretation. He showed us how, with proper understanding and research, you can find a lot of latent information about what's going on in the text. I find myself doing something similar when I read code, and when I write code.
Code reading is also archeology. There are always layers of code accumulated over time, and you can start to see the minds of the people from years ago. And if you understand the constraints they were under and the assumptions they had, then it can help to understand "Why the hell did they do it _this_ way?"
[0] https://www.amazon.com/critics-hornbook-Reading-interpretation/dp/0690008848 https://www.amazon.com/critics-hornbook-Reading-interpretati...
- wglb 3y agoSounds like you are invoking Sturgeon's rule.
- dimal 3y agoI suppose I am. I think I’ve so fully internalized that idea that I forgot it’s not my idea!
- foundart 3y ago> it's a methodology for meticulously breaking down the meaning of every word, phrase and reference in a text, without resorting to any subjective interpretation How many words have only one meaning? In the presence of words with multiple meanings, how does one non-subjectively choose the meaning to apply to a particular usage when dissecting a particular work? I'd love to hear more.
- dimal 3y agoIt’s been a long time since I did it at school, so I think what I do with code is more “informed by” that process than a duplication of it. But one specific thing I remember was that you look at context. One example I remember from school was reading The Love Song of J. Alfred Prufrock, and how by describing the fog as yellow and a few other details, we could infer that the setting was almost surely London, although that’s not stated. Another fun thing was reading old literature at looking up word after word in the OED to understand what a given word meant at the time that the text was written. This was a mind-blower. All these sentences that seemed very pretty but kind of confusing suddenly became very clear when you interpolate the older meaning. And then every clue you get builds up more context that you can use to infer other aspects about setting, character, etc. So, I think there is a fair amount of inference, but it should always be logically and objectively grounded.
- tgv 3y agoWhat characteristics does code share with literature? Code is more like a manual. Or rather, that's exactly what it is.
- dimal 3y agoI have a crazy theory that when we read code, we actually read it as a narrative, because that's how our brains are wired. And we can't help it. It's baked in.[0] Good, readable, code tells a story. (Here is the protagonist(s), the value(s) you're starting out with, next is the journey, the transformations on the data, then the conclusion at the end is the return value.) This is why I like functions more than objects. Each function is a self-contained story. Bad code is like reading a stream of run-on sentences with no coherent beginning, middle or end. It's like hearing a story from someone who gives you all the irrelevant details of whatever they're trying to tell you and doesn't get to the point.[1] [0] https://medium.com/the-protagonist/the-science-behind-storytelling-51169758b22c https://medium.com/the-protagonist/the-science-behind-storyt... [1] https://youtu.be/n5CgGTziQ4Y?t=61 https://youtu.be/n5CgGTziQ4Y?t=61
- Terr_ 3y ago> And we can't help it. It's baked in. I often like to point out that our instinctive need to see narratives (or aversion to the inexplicable) is so strong that we construct stories even onto situations where we know (in other moments) that the story is wrong. Gambling is a great example, and it's easy to see when people are flipping coins while insisting that recent past flips determine the next flip because of "a hot streak" or "the other one is overdue".
- foundart 3y agoAs someone with formal education in both literature (including lots of analytical essay writing ) and computer science, this resonates strongly with me and is a great addition to my toolbox for thinking about code. I'm wondering how useful it would be to deploy among my colleagues who don't have similar backgrounds. Have you tried that?
- 3y ago
- 13of40 3y ago> trash literature From a business perspective, maybe it should be trash literature. (Edit: I mean in the "It was morning and the sun came up, which made it less cold." sense.) When I code, I try to write all of the comments first, then fill in the implementation that matches the comments. It's typically very dry prose, and you get things like "Walk through the collection and pick out all of the orange widgets", but at the end of the day you're not trying to stir emotions with this stuff, you're trying to make the next person have less of a headache understanding it.
- routerl 3y agoClear and concise prose does not "trash literature" make. Vide Hemingway. Code absolutely should be readable and as obvious as possible, but that itself can often be a sign of virtuosity; you've broken down the problem into such simple steps that reading it is easy. To paraphrase Mark Twain, writing a short and clear program often takes much longer than a convoluted one. "Trash literature" is often full of unnecessarily adorned prose.