Live data from Hacker News

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

news.mit.edu

11–20 of 212 posts

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

#11
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…

What I understand from this is that it could be that with 30 years of programming experience, the region of the brain that carefully reasons through unfamiliar problems activates less.

That would make sense: if you are unfamiliar with programming, it makes sense that the unfamiliar problems zone activates.

It would be interesting to study this, to know if this zone activates because of the unfamiliarity or if it still activates with experience while dealing with code.

It could be that the zone will activate regardless (i.e. because when you are reading code, you are somehow always dealing with unfamiliar stuff - because this is why you are reading code in the first place usually) or not (i.e. because reading code is now familiar).

> But doesn’t that invalidate any comparisons with natural language processing, something that the test subjects do have decades of experience in?

It could: the test subjects would probably need experience in both natural language processing (which they have) and programming for the comparison to be fair. We most likely won't have "as familiar in both stuff", so we'll most certainly have to just do with "familiar enough with code".

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

#13
post #6

"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…

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, people should just be vary not to use language ideas for PL.

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

#14
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…

> 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), but a communication does not need to be two ways.

> 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).

You seem to set yourself in the end user perspective, but the developer is also a human, and I'm in the developer's perspective here.

> people should just be vary not to use language ideas for PL.

Agreed, some / many ideas applying to natural languages don't apply to programming languages. But some do.

> the vocabulary works very different

Absolutely. There are strong differences.

(of course, it's fine we don't agree, we are arguing on definitions)

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

#15
post #12

People have always told me the best programmers/computer scientists are also great mathematicians and this seems to support that. Esp thinking about Turing, Von Neumann and Knuth

Academic/theorical computer scientists, totally.

But pragmatic programmers / software engineers, try reading the average PhD's python code. Usually it is a mess.

Knuth may be an exception, rather than the rule.

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

#16
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…

> people should just be vary not to use language ideas for PL.

(s/vary/wary/, I suspect.)

Why not? I thought of crafting a system as telling a story about what the system was going to do, whether or not it involved an interaction with users. The syntax and structure is extremely precise compared to literature, but if it doesn't tell the story clearly, it's less likely to be a successful effort, both in use and for maintainers.

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

#18
post #14

Earlier quoted context omitted.

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…

> 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 languages. They also have a rules (grammer?) and patterns (vocabulary?).

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

#19
This definitely feels intuitively correct, at least for how my brain works.

When I'm reading language (prose), so much is happening -- what is the writer's overarching point and how does this fit in, parsing tons of ambiguity (a word can have lots of meanings), picking up on the writer's "style" (short and to the point? verbose and flowery?), sometimes enjoying the rhythm and even "musicality" of a sentence, visually imagining a "picture" if it's literature, and so forth.

When I'm reading code, it feels much more like following Lego set instructions, or a math proof. And I'm going slowly. It absolutely feels like I'm using a completely different part of my brain from when I'm reading.

Yes there's a little bit of overlap -- variables can use long descriptive names, and I might be reading a non-fiction article about economics that uses some of they math-y concept-building I use in reading code. But that's about it.

Technically both have a "grammar", but they written language grammar has a flexibility and artistry and ambiguity about it, while computer grammar is rigid and logical and unyielding. Interpreting them feels like they use very different parts of the brain indeed.

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

#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.
Post reply on HN