Live data from Hacker News

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

news.mit.edu

141–150 of 212 posts

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

#141
post #101

Earlier quoted context omitted.

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

Both programs and math proofs are allowed to be written in story mode where definitions can come after their usages. Unless you write in C. There's no story mode in C :-)

But there’s a postmortem, in the core file.

Maybe that’s just a photo of the crime scene.

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

#142

> It’s not the same as language, and it’s not the same as math and logic Not the same as logic? What?? Code is literally logic itself. Code that works with all supported parameters is logically correct code by definition. It's often impossible to prove exhaustively but it can be inferred with very high confidence in many cases. Producing correct code is the goal of all good developers. Just like producing correct equ…

You missed a paragraph that would help out your understanding of what they're discussing and studying and remove the need to spam the '?' key in mock outrage:

> Previous studies have shown that math and logic problems seem to rely mainly on the multiple demand regions in the left hemisphere, while tasks that involve spatial navigation activate the right hemisphere more than the left. Working with Marina Bers, a professor of child study and human development at Tufts University, the MIT team found that reading computer code appears to activate both the left and right sides of the multiple demand network, and ScratchJr activated the right side slightly more than the left.

She didn't say anything about what code is in relation to math and logic, she was speaking about how the activated regions in the brain are different between the two tasks. And per the study they are different, or, as she said, "not the same".

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

#143

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.

Perhaps reading code activates the same arras as reading prose in English, but running code in your head activates other areas

Reading code and not running it is like reading a Spanish text but not knowing Spanish. Running it is equivalent to comprehension.

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

#144
post #58

Earlier quoted context omitted.

Maybe compare to second year students of a very foreign language... (Though I have to say, I'm a self-taught programmer with an academic background in theoretical linguistics as well as university-level experience of several languages quite different to my first language, and this result doesn't not surprise me. There are some obviously analogies to be made at some levels, I think the similarity between human languag…

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

Why?

Unwrap a loaf of bread

Pull out two pieces

Put them side by side

Spread peanut butter on the left one

Spread jam on the right one

Etc.

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

#145

Earlier quoted context omitted.

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

> “Story” mode is why I like to organize my code top-down, often with definitions appearing after their usages. Yes, it drives me nuts that e.g. Python makes you put the definitions before their use!

[deleted]

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

#146

Earlier quoted context omitted.

Perhaps reading code activates the same arras as reading prose in English, but running code in your head activates other areas

If you read code and don't think about what it's doing, are you really "reading" it? Reading code without running it in your head feels like reading prose without actually comprehending it.

Sometimes working out the details what is the right output of a piece of code (like, in the line x = f(15), is x 2345 or 2346?) is very time consuming

It's also sometimes unnecessary to understand the high level picture of what the code does (like "oh, this computes the GCD using Euclidean algorithm, I had to code this in uni once")

So, most people read in a higher level fashion and understand just fine. It's really like reading math. When you read 23443 + 54454 * 454534, do you need to work out the computation to understand what this does?

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

#147
There is a study i read a while ago which basically said fMRI pattern comparison studies may be suspect because of what fMRI actually does. "Lighting up" may not mean much, at least not in the sense of how papers that do this comparison. It is a shame that I can't locate it. There is probably a book on this topic as well.

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

#148

Earlier quoted context omitted.

> “Story” mode is why I like to organize my code top-down, often with definitions appearing after their usages. Yes, it drives me nuts that e.g. Python makes you put the definitions before their use!

well, it is like introducing the characters before they play a role

Compare https://en.wikipedia.org/wiki/In_medias_res

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

#149
post #119

Earlier quoted context omitted.

There is CWEB. Literate programming is the ultimate story mode.

wtf is CWEB? I presume you're referring to something other than "China Internet Index Bull 2X ETF"?

The clue is in the next sentence.

If you look for cweb by itself, you might get weird results, because there are only so many four letter acronyms / words. Look for 'literate programming cweb' or just 'literate programming'.

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

#150

Earlier quoted context omitted.

Perhaps reading code activates the same arras as reading prose in English, but running code in your head activates other areas

If you read code and don't think about what it's doing, are you really "reading" it? Reading code without running it in your head feels like reading prose without actually comprehending it.

> If you read code and don't think about what it's doing, are you really "reading" it?

A lot of code doesn't _do_ anything. And you can still read it.

Eg I'm thinking about type declarations, or constraint based programming, etc.

Post reply on HN