Live data from Hacker News

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

news.mit.edu

21–30 of 212 posts

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

#21
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 task mainly activated the so-called multiple demand network. This network, whose activity is spread throughout the frontal and parietal lobes of the brain, is typically recruited for tasks that require holding many pieces of information in mind at once, and is responsible for our ability to perform a wide variety of mental tasks.

There is language of course, but I'm not working hard to process the language so it wouldn't show up as an fMRI signal. I am often holding several things in mind at once, including things like what the code does, what the authors are trying to do, what the author's background might be, how similar software works etc.

I did study math, and it also doesn't really feel like reading or doing math.

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

#22
At the risk of just being flippant, duh. Language is a means for expressing thoughts, feelings, emotions, and data. Code is a means for instructing a machine how to behave. One encapsulates as much of the experience of being a human as we've been able to cram into it, and the other is a shopping list. They are not the same.

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

#24
post #20

I can tell this is true because every now and then with enough syntactic sugar I write code that CAN be read almost like language, and reading it that way takes a shift of mind that feels weird. It’s like putting on a different set of goggles.

Yeah I feel like this is why fluent APIs sometimes irritate me. Like they can be clever, and can be natural:

do(thisThing).and(thisOtherThing).until(someStopcondition)....

but when this breaks down it becomes quite ugly.

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

#25
post #6

Earlier quoted context omitted.

I disagree. Wikipedia's definition [1] is what I had in mind for language: > Language is a structured system of communication that consists of grammar and vocabulary Programming languages are structured, have grammars (often described formally using a grammar definition for some parser generator) and vocabulary (the set of functions and types you can use, possibly modules and package, basically), and they are used to…

Who are you "communicating" with? A programmer does not communicate with a computer, through a PL. He or she writes it down, to later be executed or interpreted, so the computer can "communicate" with the user, through the User interface (not the PL). Also, the vocabulary works very different, in a PL almost all of the vocabulary is defined "at hoc", as you go. I mean I don't have a problem calling them a language, p…

To me, the biggest dividing line between mediocre and good programmers is who they write code for.

The mediocre ones write their code for the computer/compiler/interpreter. When it works, they're done.

The good ones write their code for human readers to understand, including their future self.

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

#26

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…

To me reading code is reading math. It feels exactly the same. Same pattern about holding lots of things in mind at once.

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

#27
post #14

Earlier quoted context omitted.

> Who are you "communicating" with? I wrote this: "with the machines, and with fellow developers" > A programmer does not communicate with a computer, through a PL I disagree with this. The programmer describes the steps that the computer needs to perform, to the computer. Or the programmer describes the state which the computer should reach. The communication is one way (except, arguably, during debugging sessions),…

Even if you consider it communication, that doesn't make it a language. Plenty if communication happens through other means. If we look at the debug session or bash scripting, the closest thing of a two way communication. It doesn't "answer" in code. I see code closer to something like a Floor Plan an architect may use or a CAD drawing from an engineer. Both of them also communicate, but they are not considered langu…

> Even if you consider it communication, that doesn't make it a language

In my first comment, I have broken down the definition of language I found and (supposedly) successfully applied each part of it to programming languages (communication being only one of the features).

Where is my mistake?

Either the definition is wrong, or incomplete, or one of the matches I made is erroneous, or I missed a match.

> an architect may use or a CAD drawing from an engineer. Both of them also communicate, but they are not considered languages. They also have a rules (grammer?) and patterns (vocabulary?).

Tough one, maybe those drawings are indeed expressed in a language, just that we don't usually see it as a language / think of it like this. That would apply to map symbols as well [1].

edit: Just noticed French Wikipedia [2] actually cites cartography as a language without a syntax, so that would check out:

> la cartographie est un exemple de langage non syntaxique

("Cartography is an example of non-syntactical language")

French Wikipedia broadly has the same definition for language as English Wikipedia, but makes the grammar part optional.

We could argue that the examples you cited are indeed not languages using the English definition because they don't have grammar (if rules you mentions are not grammar - and indeed you would probably not need a pass of syntactical analysis to "parse" a CAD drawing)

[1] https://en.wikipedia.org/wiki/Map_symbol

[2] https://fr.wikipedia.org/wiki/Langage

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

#28
We have come to see with LLM's that language can be generated by using math.

Would love to see if this is the same when reading different patterns of code - functional vs object oriented. Where do product specs or technical specs lie?

All of this feels more pseudo-science to me - the distinction between language and math is not well understood at the moment.

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

#30
post #8

From the linked article, they found that it activates the region of the brain that carefully reasons through unfamiliar problems. They also speculate that this might not generalize to people with 30 years of programming experience. Well, fine, a lot of academic research is done with students. But doesn’t that invalidate any comparisons with natural language processing, something that the test subjects do have decades…

I would be very curious to see what happens when the subjects are looking at a codebase they are familiar with. Even if there is some code within the repo they haven’t seen yet, the familiarity from style, convention, and knowing how the code fits into the rest of the program as a whole probably has a large impact as to how it is perceived.
Post reply on HN