Live data from Hacker News

To the brain, reading computer code is not the same as reading language (2020)

news.mit.edu

91–100 of 212 posts

Re: To the brain, reading computer code is not the same as reading language (2020)

#91

I run a YouTube channel that's mostly devoted to reading code: https://www.youtube.com/@ants_are_everywhere I (try to) read code from popular open source projects. It's a bit like sight reading in music because the idea is that I go in blind and try to make sense of it. This rings true to me: > The researchers saw little to no response to code in the language regions of the brain. Instead, they found that the coding…

> It's a bit like sight reading in music

I was wondering if there was any correlation in the ability to sight read music and to quickly understand code.

I played a few musical instruments as a child and teen but never got good at sight-reading.

I've heard that musical ability and programming ability are often correlated but I could never have made it as a working musician. I did make a good career out of programming though.

Re: To the brain, reading computer code is not the same as reading language (2020)

#92

Not surprising at all, reading code is not like reading prose, not even doing math, is more like a puzzle building in the brain. There's a myriad things to mentally connect and substitute/translate in realtime in order to understand what the code is doing: each function, symbol, variable, statement, abstractions all the way down that makes reading code even more complex than writing it in the first place.

Yes, and I think the argument could be made that code is the exact opposite of language, since it's a set of machine instructions that lay out what the computer will do and can't, or won't or shouldn't, be a metaphor for something else as happens in the domain of language.

Re: To the brain, reading computer code is not the same as reading language (2020)

#93
post #10

The paper wasn't linked as far as I can tell but is probably https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7738192/pdf/eli... > While the programmers lay in a functional magnetic resonance (fMRI) scanner, the researchers showed them snippets of code and asked them to predict what action the code would produce I have a suspicion that writing code and understanding that written by someone else are different skill sets.

I feel like this is akin to asking someone to read a fairytale and to tell you how many times a person crossed a bridge in it, or what they carry in their hand in the end, or where the apple is when all is done. I don’t think this is about understand what is written, it’s about figuring out what that which is written means.

That’s an excellent point.

I’ve realized that I sometimes read code in more of a “story” mode, where I’m just looking for the gist of what’s happening and what it is “about” rather than the nuts and bolts of how it actually works.

Re: To the brain, reading computer code is not the same as reading language (2020)

#94
post #53

I'm more surprised that anyone with any experience in programming languages has actually thought this could be the case. Making programming languages superficially more like human languages is one of the classic rookie mistakes of programming language design. (See Perl's "do what I mean" paradigm and the chaos that resulted from it) I think two important differences right there are that programming languages are more…

>> Making programming languages superficially more like human languages is one of the classic rookie mistakes

one of the least productive programmers I've worked with was obsessed with Groovy

Re: To the brain, reading computer code is not the same as reading language (2020)

#95
post #75

Earlier quoted context omitted.

> I think the similarity between human languages and computer code is frequently overstated It wouldn't even occur to me to think of them as belonging to the same category.

Occasionally you come across languages that do and, at least to me, those languages feel extremely difficult to deal with. For instance, I found AppleScript and HyperTalk to be awful to work with. I also notice that some junior programmers I've worked with tend to argue for coding styles in mainstream languages that read almost like sentences. Not sure if this is a generational thing or an experience thing.

I’ve seen the same thing, it might be generational. Someone arguing that we need an isNotEqual(a, b) helper in addition to isEqual(a, b), because that’s supposedly “cleaner” and more readable than !isEqual(a, b). They were very vehement about it, but I don’t get that at any level. It’s more lines of code to write and maintain, more unit tests, more characters to type at the usage site and to me, reads exactly the same way.

Re: To the brain, reading computer code is not the same as reading language (2020)

#96
> “Understanding computer code seems to be its own thing. It’s not the same as language, and it’s not the same as math and logic,” says Anna Ivanova, an MIT graduate student and the lead author of the study.

I'm not sure if this is what they are implying but I find the statement "reading computer code is the same as reading language or math or logic" to be an odd null hypothesis.

Re: To the brain, reading computer code is not the same as reading language (2020)

#97
post #96

> “Understanding computer code seems to be its own thing. It’s not the same as language, and it’s not the same as math and logic,” says Anna Ivanova, an MIT graduate student and the lead author of the study. I'm not sure if this is what they are implying but I find the statement "reading computer code is the same as reading language or math or logic" to be an odd null hypothesis.

Every one of these are languages and I'll add music. The purposes and constructed of these types of languages vary so should the thought processes.

Computer programs can be written in a proof/solver language which would get closer to math/logic. This puts things on a grayscale IMO.

Re: To the brain, reading computer code is not the same as reading language (2020)

#98
post #10

Earlier quoted context omitted.

I feel like this is akin to asking someone to read a fairytale and to tell you how many times a person crossed a bridge in it, or what they carry in their hand in the end, or where the apple is when all is done. I don’t think this is about understand what is written, it’s about figuring out what that which is written means.

That’s an excellent point. I’ve realized that I sometimes read code in more of a “story” mode, where I’m just looking for the gist of what’s happening and what it is “about” rather than the nuts and bolts of how it actually works.

“Story” mode is why I like to organize my code top-down, often with definitions appearing after their usages.

It makes the code read more like a story from top to bottom.

Some like to organize their code such that any term always appears before it is used. Like a math proof or something. I find this somewhat pleasing but unhelpful for understanding the “story” you mention.

Re: To the brain, reading computer code is not the same as reading language (2020)

#100

"Language" in the context of PL is a misnomer. People even scientist seem to fall into that trap (remember the literate programming movement). PL's are better described as "Specifications". More similar to file format specifications, later converted to executables or interpreted. > the researchers showed them snippets of code and asked them to predict what action the code would produce. That is only (a small) part of…

Yes, obviously there is some conceptual similarity to written language, but the goals are really quite different. Human language is used to communicate, which involves theory of mind and modelling the listener. Programming language is just specifying a computation to be performed. Still, it's interesting to consider why the "language areas" of the brain apparently are not used for reading or writing computer language…

I tried asking both Claude Sonnet and GPT-4 (Bing CoPilot) about this, and they referred to the brain using "selective activation" to only enable language areas for language inputs, but both talked in circles and couldn't explain how this "selective activation" actually works - how does the brain (starting from nothing - no knowledge of written language) start to selectively activate Wernicke's area only for language? Its more understandable how processing gets consolidated there, and suppressed elsewhere, once it gets started!
Post reply on HN