r/programming • u/remind_me_later • Dec 16 '20
To the brain, reading computer code is not the same as reading language
https://news.mit.edu/2020/brain-reading-computer-code-1215249
u/GameofCHAT Dec 16 '20
Maybe because you never end up speaking it?
Or maybe because it is more of a puzzle?
217
u/JackandFred Dec 16 '20
Yeah I think it’s the second reason. When I read a book it’s like hearing a story, it’s more like simulated talking, theres a narrative thread to follow. Reading code is more of following a logic thread, much more similar to looking at math than reading a novel
59
u/anasiansenior Dec 16 '20
Logic thread is the perfect way to describe it- and that's simply because that's how the computer reads your code. I won't be able to find the issues the computer is having with it if I'm not reading through it the same way. Lord knows I've wasted lots of time looking for bugs trying to skim through code assuming things work a certain way only to find that isn't the case.
2
u/MrsRibbeck Dec 16 '20
I wonder how the MRI scans of people reading academic papers would turn out. If I am reading a paper where I am not proficient in the topic, I have to build a logic map of the contents as well, at least if try to understand it in depth instead of just reading it.
→ More replies (1)→ More replies (2)2
u/Acetronaut Dec 16 '20
3/10 code. The flow and pacing were fine, but the main character was pretty boring and the plot was tangible, but felt like it didn’t matter.
→ More replies (7)10
u/Certain_Abroad Dec 16 '20
Regarding your first point, when I saw the headline, I first thought of Felienne Hermans. She does a lot of work into teaching methodologies for beginner programmers and particularly around copying methods that have worked in other disciplines. One of her major findings was that having students read code aloud in class (like schoolchildren learning to read would do) helped a lot.
I don't doubt her research, but this article has lent a bit of support to my scepticism that the benefit is coming from similarities between reading code and reading language.
→ More replies (2)
387
u/photonymous Dec 16 '20
I've been wondering about a related issue. Is writing code the same as writing a human language? This study makes me think that we can reason by analogy and conclude the answer is probably no.
316
Dec 16 '20
I guess code has a very rigid formal grammar, while language leaves a lot of room for interpretation. Maybe that's one difference.
93
u/r0ck0 Dec 16 '20
I really wish stuff like legal contracts + tax guidelines etc used more brackets like in maths, e.g:
You must do (A) or (B and C)
...instead contracts etc are still way too focused on reading like regular paragraphs, and we get more ambiguous stuff like:
You must do A or B and C
I really don't get why they can't use more brackets for this kind of stuff.
Pretty much everyone (who would be expected to be able to read legal contracts etc) knows that's how they work in maths, it doesn't require programming knowledge. And even those who might not be used to the brackets will catch on pretty quickly.
I can't see any downside to making things clearer like this. Just seems to be another thing where nobody wants to break conventions, and everyone loses.
34
Dec 16 '20 edited Dec 16 '20
You must do A or B and C
You can write that as:
You must do [one of]:
A or
B and C
and it's clear.
→ More replies (12)9
u/87_percentrum Dec 16 '20
It's kinda ridiculous how we have created all of these fantastic tools to manage all aspects of such a complex thing like programming such as version control, change logs, detailed documentation including use cases, known bugs, TODO, IDE's with code completion and linters etc. and nobody has incorporated any of them into something that seems equally as complex like law.
Imagine a lawhub! Or LawStorm with a realestate law extension for your region!
Feels like this should be a thing by now...
→ More replies (2)8
u/ptoki Dec 16 '20
I like your point.
I also wish that law was either more down to earth with explanation what is the idea behind it or more rigid in a way code is.
The current way the law is formulated is not strict enough but also does not contain clear message (even if not really precise).
Disclaimer: some regulations are actually pretty well formulated. But unfortunately not everything.
→ More replies (1)→ More replies (7)6
u/Vectorial1024 Dec 16 '20
No offense but the problem still exists:
Lets say I want to explain
You are not allowed to eat You are not allowed to drink Both statements are applicable at the same time
I want to explain that in one sentence. How should I do it?
"You are not allowed to eat or drink"
NOT OR = NOT AND NOT, supported by Boolean algebra, should be the standard/accepted way of writing it, but those unaware may think you can still "eat and drink". They take the or as XOR.
"You are not allowed to eat and drink"
The ban covers eating UNION the ban covers drinking. But similarly, some may think you can still do either one of them by taking the AND first, then NOT it later.
The English language has the ambiguity of OR/XOR and AND/UNION, and so we have multiple minimal parse trees hence multiple possible meanings in the same sentence. Unless some English linguist board decides to approve of the ambiguity fix and push it, otherwise the problem will still be here. And also, with such a fundamental change some may argue that "it aint English anymore"
Besides, ambiguity makes human languages beautiful. It enables us to survive in harse, hostile conditions. Auto censorship is also harder due to ambiguity, and it is definitely helpful.
→ More replies (3)329
u/CoffeeTableEspresso Dec 16 '20
My code is very sloppy so maybe it's the same for me
600
→ More replies (1)4
7
u/Francois-C Dec 16 '20
I guess code has a very rigid formal grammar
Agreed. Also it doesn't allow polysemy at all, neither irony or sarcasm that would need a judgment from the compiler or interpreter.
As a French-speaking (bad) amateur programmer and (decent) Latinist, I always felt like writing in Latin, a language that has not the same structures as modern ones, was closer to programming, because it makes me make a detour in my thinking, identify precisely the reality to be translated, then transpose it into a system of signs that works differently.
But programming is also like building an automated machine.
→ More replies (3)10
5
u/saracuratsiprost Dec 16 '20
Grammar? How about semantics? Rigidity of computer language semantics vs human language semantics is constant vs inf.
→ More replies (8)4
u/Norapeplox Dec 16 '20
That's why English sucks. HEY HEY HEY, YOU USED A WORD WITH MULTIPLE POSSIBLE DEFINITIONS PREPARE TO BE MISUNDERSTOOD AND GANGED UP ON BY SEVERAL NARCISSISTIC HAIRLESS MONKEYS!!!
→ More replies (3)27
u/veciy Dec 16 '20
Speaking from second hand experience: My father is a software developer with dyslexia. He can read well but it's almost impossible for him to spell anything. But he has no problem writing code in basic text editors like notepad++ without any variable name corrections and such.
It's day and night watching him program and trying to type in Google search.
10
u/photonymous Dec 16 '20
Ok, that's interesting. I'm sure neuroscience could learn something from this.
0
9
u/ptoki Dec 16 '20
No its not. And it should be obvious to anyone who codes.
The primary reason its different is the fact that even if you know very well all code patterns (if, while, for etc.) Each one will look different and will require you to temporarily remember each loop/condition variable and then analyze what the code is supposed to do. And thats a non linear process.
Usually you need to read the code few times, skip here and there to get the general idea and then draw few conclusions etc.
Reading code is more like reading a map and even that is much simpler.
There are some languages which may be closer to normal text but only if the program is somewhat linear and kind of limited in content. But those are outliers.
Even mathematical equations are closer to normal text than code.
This study is poor not only by assuming that this can be compared (actually why not) but mostly because its poorly conducted.
→ More replies (3)8
2
u/themiddlestHaHa Dec 16 '20
Not even a little bit. Maybe if you were writing a story about very very well defined people/place and even one mistake would ruin the book.
2
Dec 16 '20
FWIW, programming language design and interpretation benefited greatly from the work of Noam Chomsky.
→ More replies (1)2
u/merlinsbeers Dec 16 '20
It's no. You don't write code to communicate ideas. You wrote code to cause switches to flip in a particular manner.
The mental process is closer to making something with your hands than teaching someone a new subject.
Drawing a diagram of what the code does is usually much more efficient than talking about it.
→ More replies (54)3
216
u/TheMaskedHamster Dec 16 '20
As someone who is a programmer and multi-lingual (successfully acquiring foreign languages as an adult), this is very gratifying to read.
I have seen a lot of articles and comments over the years comparing them, and even ridiculousness such as replacing language classes with computer programming. It's not something you can explain well to someone without experience doing both, and those people don't need an explanation. I haven't heard it in a while, but I have remained tired of it nonetheless.
137
u/glacialthinker Dec 16 '20
I'm surprised to learn that some people think reading or learning programming languages is related to natural languages. Just because they're called languages? I'm already tired of it too, and this is the first I've heard of it!
26
u/EntropySpark Dec 16 '20
Programming languages are really different programming grammars, as the words are all still English. If there was an alternate form of English in which the words were generally the same, but the word order was different and the cases were simplified, would that be considered a different language, or a different grammar? Is that even a concept?
17
u/Quadraxas Dec 16 '20
A lot of programming languages are really just different syntaxes, not even grammars.(sure there are many different grammars too but hear me out) Constructs or how you describe things are mostly same. Sure they have all their nuances and their own sugar, or the way they represent and process data is different but what would you call a "grammar" is the same. Well, like among C family languages the syntax is even very close. But there is still also a great deal of similarity in say, c and python, grammar-wise, so much so that you can implement same psuedo-code with 1:1 mapping of instructions and their order in both.
→ More replies (1)13
u/Thaun_ Dec 16 '20
Arabic Programming Language.
You write from right to left.
You have to learn the whole arabic alphabet and know how to speak it.
Its unmaintainable as fuck if you don't know arabic.
Mostly noone will understand the logic of the code, cause they can't read it.→ More replies (1)14
u/njtrafficsignshopper Dec 16 '20 edited Dec 16 '20
Alphabet, yes. How to speak it, no, apart from some key words.
I had some co-workers in a company who did not speak English or indeed a language that used the Latin alphabet, but managed just fine with English-based programming languages. The words they had to know were limited to "for," "if," "class," and the like. It's nowhere near comparable to the complexity of learning a natural language.
Of course, you would still need documentation in your own language, but then we're back to the realm of human languages, not programming.
Edit: for example, here's a list of all the English words you need to be able to use C#. Well, maybe a couple more for ubiquitous class names like List and Console. But all in all maybe ~100 words. You don't need to know English to use C#. Same for this proposed Arabic-based programming language.
→ More replies (1)→ More replies (7)9
Dec 16 '20
This theory was brought to you by insular monolingual American academics™ (isn't calling "academics" insular redundant?)
SQL is basically an attempt to make a programming language with a "natural English" grammar. Then people realized that's stupid as fuck and AFAIK the trend has since died, and though SQL is still around nobody reads or writes SQL as if it were English.
→ More replies (3)5
u/Gecko23 Dec 16 '20
BASIC and COBOL were intended to fit the same model. They aren't remotely similar to spoken language either.
→ More replies (1)13
u/ShapesAndStuff Dec 16 '20
Yea i wanna know why this is a thing at all.. One is communicating and one is solving logic problems. Just because you use words (in the broadest sense) to do both it doesn't mean they're alike.
→ More replies (3)6
u/Kissaki0 Dec 16 '20 edited Dec 16 '20
You use more than words. You use words, and grammar (structure).
And those constructs represent a concept, a meaning.
You read and write them. And that is a transformation of their meaning into a textual representation. The meaning you interpret unconsciously and understand consciously. You form ideas in your head of what they represent.
There are some similarities. It’s not that far off.
→ More replies (1)5
u/Semi-Hemi-Demigod Dec 16 '20
I disagree that programs convey meaning. Sometimes that's true, and there should be a comment describing what that meaning is. But it's more like a to do list than prose or poetry: The end result isn't conveying an idea, but getting a machine to execute the steps to achieve the desired result.
→ More replies (2)→ More replies (4)7
u/Awesan Dec 16 '20
I'm bilingual and I've been a professional programmer for almost 10 years at this point. They seem pretty similar to me?
When reading code, I'm not reading the syntax but the meaning. I create a picture in my mind of what will happen when it runs.
When reading text, I'm also not reading the words but the meaning. Again I create a picture in my mind of what is being described.
The difference is in what they describe, not how they do it in my experience. That's what I would guess is the reason for what the article describes, the subject matter is different and people use different brain areas for different subjects.
→ More replies (4)
26
Dec 16 '20
Makes sense--learning a new programming language is far easier than learning a new language.
4
u/SharkBaitDLS Dec 16 '20
They really have little in common besides the fact that the English word for them is the same. Spoken/written language is a way to express worldly concepts and thoughts. Programming languages are a way to express logical/computational concepts and commands. They’re both a means to transcribe some concept into a persistent, replayable form but the concepts they deal with are so utterly different that it comes as no surprise to me that they leverage completely separate parts of our mind.
I feel much more like I’m playing a puzzle game when I’m writing/reading code than I do anything close to what I feel when I’m working on learning another spoken language.
→ More replies (2)6
u/VeryLazyFalcon Dec 16 '20
Could it be better compared to learning new framework? You have to get familiar with new rules and remember quite big set of functions.
2
24
u/th0rn- Dec 16 '20
I wonder if they’d get a different result if they scanned the brains of the developers who wrote the legacy code I have to maintain.
6
113
u/thehalfwit Dec 16 '20
And the sky is blue.
If you're reading computer code, you're following a process. You're keeping track of variables and functions. You aren't reading so much as you are interpreting.
The only thing I could find comparable in "reading language" is if you are translating text using some kind of Rosetta Stone.
20
u/ForeverAlot Dec 16 '20
It's definitely a narrow study.
What would happen to a linguist asked to proofread a paragraph?
7
u/thehalfwit Dec 16 '20
A paragraph of code? They would do great up until they're confronted with differing syntaxes on function calls when using libraries.
4
u/immersiveGamer Dec 16 '20
I think he meant a normal written paragraph. Would a linguist or similar person adept in the written language start to look at a paragraph more logically? When explicitly reviewing it for errors and readability.
→ More replies (2)14
u/teetaps Dec 16 '20
You aren’t reading so much as you are interpreting
Lol my man reads regular words without interpreting them
2
2
Dec 16 '20
I dunno - this is like a very high level overview, and it's not necessary that the low level system follows the same rules. To use a programming analogy, it's like how the fastest way to count the number of 1 bits in an integer in Python is probably to stringify it and count characters, because the intepreter's workings don't 1-1 map to the way we think about it, which would be to do some fancy bitmasking math.
3
u/Kissaki0 Dec 16 '20
If you read a story you very much keep track of what it says though?
It’s not like you read sentences within paragraphs or articles by themselves, not taking the context into account.
24
12
u/automata_theory Dec 16 '20
Whats interesting is that exploration into natural language theory made a lot of impact on theoretical computer science. So it seems that reading code doesn't take advantage of the hardware in our heads specialized to parse languages but relies on problem solving techniques used for other tasks. One would assume that parsing a natural language, which can be incredibly complex, would be useful in parsing an artificial language. After, the big idea is that computational models and formal languages are equivalent. Of course writing code would be different.
2
u/quiteamess Dec 17 '20
I wonder if there are differences between functional programming and imperative programming with respect to the language representations being involved. David Corfield claims that we use dependent types in natural language. Perhaps the lack of typing information was the reason that language networks were not involved.
→ More replies (3)
22
u/Blando-Cartesian Dec 16 '20
Not at all surprising. Programming probably has more in common with processing chess or go.
12
u/znupi Dec 16 '20
Or doing math or physics problems. It's way more about critical thinking than it is about the code itself.
→ More replies (1)
8
8
u/znupi Dec 16 '20
“It’s possible that if you take people who are professional programmers, who have spent 30 or 40 years coding in a particular language, you may start seeing some specialization, or some crystallization of parts of the multiple demand system,” Fedorenko says. “In people who are familiar with coding and can efficiently do these tasks, but have had relatively limited experience, it just doesn’t seem like you see any specialization yet.”
Can't wait for interviews to put you through an MRI while you reverse a binary tree
14
u/tinco Dec 16 '20
The mental model you build in your head while reading code is so different. Equating them would be like saying looking at a building is the same as reading a language.
I probably choose this analogy because I do carpentry as a hobby but to me reading code is like navigating a building I have to work on. Sometimes following a path, sometimes deciding on where to go, but always taking note of the materials, the structural components, theorizing about what could fail and how. A large application is like an enormous building designed by many architects, you'd have to visit every part just to know what the materials used are, how the foundation is laid and what the roof structure is.
My partner definitely does not look at buildings this way, so this analogy probably falls flat for many people. I have taught programming to complete novices, and the process of learning programming is harrowing. It involves headaches and dreams and intense focus for weeks on end. Some gave up even though they paid thousands to do it, but most persisted and eventually almost all finally built the correct mental model.
I think the reason many of us "nerds" felt learning to program was easy is that we take an incredible amount of time to learn it, slow enough to constantly enjoy it, and our curiosity for the technical has primed our brain for understanding. I wrote my first code at around 12, but I'm pretty sure my full understanding of computers wasn't until I was 19, and I was definitely still refining my style at 25. That we could force these adults through that process in mere months (they didn't quite come to full understanding of computers) is a testimony to the flexibility of the brain.
→ More replies (1)3
Dec 16 '20
This. It's about being able to think in terms of systems at varying levels of abstraction. To use your analogy, when looking at how one room is built you need the flexibility to abstract away the complexity of the rest of the building, while maintaining it relationship to the room you're looking at. It's a constant zoom in and out from the conceptual and global to the granular and atomic levels.
→ More replies (1)
18
Dec 16 '20
Why would it be?
4
u/celerym Dec 16 '20 edited Dec 16 '20
You gotta start with some assumptions first then test them.
To be honest though I can’t for the life of me understand how either of the “two schools of thought” described in the article could possibly be on the mark, at least from my personal experience. When reading or writing I can tell that to some extent I’m vocalising what I read or write. It’s pretty subtle sometimes. For example when writing, my typing often lags behind the “vocalisation” part to the extent I don’t feel it anymore, but when I slow down it’s there.
When reading or writing code, this vocalisation doesn’t happen in the same way, it only really happens for variable names but not anything else. When reading code it’s more akin to looking at a diagram with parts slowly revealing themselves and things taking shape. When writing code it’s more like ... playing with some sort of dynamic LEGO blocks of all things. It’s a construction not a vocalisation. It’s also contextual, I know this, because I hopelessly couldn’t understand pointers for the longest time as a teenager until I learnt how computer memory works.
When doing maths it’s much closer to coding than working with human language, but it is still very different. At least in the math I’m familiar with, things naturally follow from one another when reading and writing, and when coding the writing part is much more open-ended. When reading math I don’t really form as complex structures in my mind as I do reading code. It’s the difference between running a string of thread through fabric with a needle regularly and working with clay.
5
5
u/bboyjkang Dec 16 '20 edited Dec 16 '20
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
How much of this difference is information load?
With language, I’m reading sequentially.
Even if I don’t understand it, it’s a straightforward direction.
I’m not a programmer, but every time I look at code, I keep having to ask, “where does this come from?”
e.g.
print(next(myit))What’s myit? Go search for where it was defined, and remember that when you return.
myit = iter(mytuple)What’s mytuple? Go search for where it was defined, and remember that when you return.
mytuple = ("apple", "banana", "cherry")I don’t know what professional tools that programmers use, but I wish I could insert random yet constrained inputs, and follow them as they jump around the code.
(Similar to that pythontutor.com code execution visualization website)
I’m really bad at "holding many pieces of information in mind at once", as the article mentions.
3
u/THROW_AWAY_MUSIC Dec 16 '20
I don't know if it was a rhetorical question or not, but if not most IDEs like pycharm have a jump to definition feature.
→ More replies (3)2
u/TheGreaterGuy Dec 16 '20
I think of this relay-race type reading similarly to when authors repeat themselves over and over, to highlight multiple angles of their viewpoint.
5
u/KingMaple Dec 16 '20
Sometimes people do a lot of work and research to essentially state the obvious. I had no idea this was under debate.
→ More replies (1)
5
u/Mad-A-Moe Dec 16 '20
I can see this. I'm terrible with human languages. I say that C is my native language.
I'm a native English speaker. After living in Germany for 3 years, I was told that I speak German like a very young child. :) My Chinese friend spent 6 months in Germany and speaks it better than me. In fact, she said her English is better than mine. :(
5
u/salgat Dec 16 '20
This is what frustrates me about people who say code is self documenting. Yes, obviously you can derive what code is supposed to do if you spend enough time analyzing it, but that's an extra layer of translation you have to go through that can be avoided by a few well placed comments with explanations on what and why is going on. This is especially crucial when you're fire fighting and every minute production is down is thousands of dollars lost.
4
Dec 16 '20
How would sarcasm work? It is truly a subset of the human communication. Can you type sarcasm in a computer language other than Javascript?
4
u/theAnalyst6 Dec 16 '20
I can't listen to music and read at the same time but I can code and listen to music. A different part of the brain must be used for coding.
→ More replies (1)
4
Dec 16 '20
Judging from the comments I see in code, writing code does also not activate the natural language processing center
6
u/bamigolang Dec 16 '20 edited Dec 16 '20
A study from 2012 found that programming is highly related to language processing. They used fmri to scan the brain activity of the participants. So I am very interested in why there is this difference between the two studies.
"Having found a strong involvement of language processing suggests that we need excellent language skills to become excellent programmers. Thus, if we loved learning new languages, we might also more easily learn new programming languages."
Sigmund er al. 2012, Understanding Understanding Source Code with Functional Magnetic Resonance Imaging
2
u/Blando-Cartesian Dec 16 '20
If I looked at the same paper, those participants were all students. Beginners on any activity process things very differently from professionals. Code is superficially words so it seems natural that students read "if", "while", "private", "final" etc. I would bet that seasoned developers process patterns and their interactions similar to how chess masters think about chess.
3
u/ironclad49er Dec 16 '20
Seems like they're ignoring that both natural language and programming languages can be used to describe different things. It would be interesting, for example, to see the comparison between an imperative language and a formal declarative language like SQL or a markup language like HTML And you could likewise compare each of those to reading different types of natural language (e.g. law, scientific literature, prose, poetry, imperative instructions like cookbooks).
3
u/bam707 Dec 16 '20
Broca’s area and other language centers have been shown to be involved in the interpretation of some types hierarchal data structures. This is a big debate in the fMRI field at the moment. In a sense, for loops and if statements impose a natural hierarchy to the progression of a program which could employ classical language regions while interpreting(?). Very interesting; I proposed an experiment like this in my PhD qualifying exam and (luckily) passed last September!!
→ More replies (1)
3
Dec 16 '20
I speculate a gradation. Reading a very difficult philosophy or neuroscience paper would activate similar neural regions as reading code.
Conversely, reading a bog standard mvc java program may activate similar neural regions as reading this reddit post.
In other words, cognitive complexity plays a big rolle heree
3
3
3
u/PotatoSquisher Dec 16 '20
" the researchers showed them snippets of code and asked them to predict what action the code would produce. The researchers saw little to no response to code in the language regions of the brain. "
To me this is not reading code, this is problem solving. To test reading code then they should have put statements or function calls on the screen to test if the person knew what it meant. having someone solve the problem is not reading code, its problem solving.
3
3
u/thesaferchoice Dec 16 '20
I've been writing code for 3 years and I never felt like I was speaking another language.
3
u/CryZe92 Dec 16 '20
Wasn't there a post here like 2 months ago or so that reading code turns out to activate the same regions in the brain as natural language?
Update: Found it https://www.reddit.com/r/programming/comments/gxjd9o/brain_scans_reveal_coding_uses_same_regions_as/
3
3
u/Josuah Dec 16 '20
I'd be interested in brain scans of English/Literature academics reading, maybe focused on works heavy on analysis. Reading Dante's Inferno is very different from reading People magazine.
3
u/LionaltheGreat Dec 16 '20
Anecdotally, I would say, OF COURSE. When reading code you're literally building a memory map or "blueprint" in your head of the system architecture and various layers of abstraction. It's more like zooming in and out of a CAD design.
Going from that state of mind directly into a meeting requires a HUGE shift in thinking. Not just context but also the way you think and interact.
Very cool study.
7
2
2
2
2
u/bobsbitchtitz Dec 16 '20
Maybe, but I truly feel like for me reading code is extremely similar to reading regular text if I'm well versed in the language.
2
u/close_my_eyes Dec 16 '20
I wouldn't have thought it had much to do with my language centers in my brain. When I read code, it's like there's a big 3-d diagram in my brain and I can see all the parts and their interactions.
2
u/MondayToFriday Dec 16 '20
This somewhat conflicts with the recent paper from Prat et al, 2020, which says that a person's ability to learn programming languages correlates with their natural language aptitude (more so than with numeracy). The "contradiction" is probably a matter of reading the fine print than that one disproves the other. This paper focuses more on which brain regions are activated when reading code, while Prat measures how well math/verbal-oriented people learn to code.
In terms of real-world relevance in most contexts (predicting which people would excel at programming), Prat's result is probably more relevant. For most practical purposes, we don't really care which brain regions are active when reading code.
2
2
u/acroporaguardian Dec 16 '20
Yes, the scabs on my head where I pulled my hair out agree.
No one ever said "don't trust an English teacher you can't throw out the window."
Although if said teacher were in Prague and it was Defenestration of Prague time...
2
2
u/mgudesblat Dec 16 '20
Seems there are a number of folks that take offense to this paper :/
I've never felt that reading or writing code is in any way equivalent to language. I use language to describe code. I can technically discuss an entire program with only language (though visual aides are also very helpful). I cannot do the reverse (yet haha, I know ai has made facsimile but nothing that we could understand).
I think the idea that some folks are taking offense bc they feel that coding is THEIR language, and part of their identity. Which is fine, but I would not equate reading code to reading english. Learning may be similar; however, I'd argue it's similar because of how we learn, less than that a foreign language and coding/programming are similar.
Credentials: Russian was my first spoken language English was my second spoken, first written language Picked up reading russian recently (late 20s), still can't write it Current software dev
→ More replies (3)
2
u/PM_ME_YOUR_PROOFS Dec 16 '20
I feel like the fact that I've picked up over 30 or more programming languages and yet struggle to learn even one new natural language and that this is pretty common should have been solid evidence for this. I guess it's nice to have some science behind it
2
u/feverzsj Dec 16 '20
well, there are normal language thinkers, and there are also visual thinkers, who typically have high IQ but suck at lingual expressions.
2
u/dethb0y Dec 16 '20
i'm not surprised, human language and programming "languages" are so totally different. I guess i'd be surprised if anyone thought they were similar.
2
Dec 16 '20
"Reading computer code" is a technical term. It's like saying for example, that the cell is "reading" a DNA sequence or something. When we "read" a program's source code, it's more akin to studying a technical diagram of an engine or a circuit board - we study the architecture of that software and try to understand it's design decisions and so on.
2
u/Semi-Hemi-Demigod Dec 16 '20 edited Dec 16 '20
It's anecdotal, but reading code to me is much more like building an intricate device, like a watch. There are a bunch of parts that need to mesh, and details matter a lot. I visualize code working together in a vaguely tactile way, with each piece of code having a "shape" that can connect to other shapes to do something.
2
u/sarhoshamiral Dec 16 '20
I never thought it would be and I hate very verbose languages that try to make it similar (looking at you VB)
To me reading code and reading math always felt same in college, neither felt like reading a book though
2
u/General_Example Dec 16 '20
In a way, this isn't surprising because we don't "speak" programming languages
I read a book a while ago that makes the case that language is not a learned skill, but is part of the behaviour of speech - similar to how birds create nests.
I'd be keen to see how writing code compares to writing, say, an essay, because writing is certainly more of a "learned skill" than speaking is.
2
2
u/TheFeshy Dec 16 '20
I'd bet it would be more similar to writing a story. Just casually reading is going to be pretty different than re-reading a section of your book, looking for inconsistencies, grammar, and new plot ideas.
3
u/austinwiltshire Dec 16 '20
I'd be interested in comparing these fmri results to people reading music.
3
Dec 16 '20
The difference would be, in music everyone follows the same rules, in code, there are new functions, new parameters and and new variables with each tract, depending on the temperament and habits of the programmer, when it comes to code, you know the rules but it takes a lot of effort to read the paragraph, with music... not so much
2
u/minus-zer0 Dec 16 '20
I wonder if this is the root cause of 'the knack'. I have always noticed that there are some people who think like a programmer right off the bat and those that really have to put conscious effort into it*, even deep into their career. I wonder if the ability of your brain to switch from language to general processing mode has a link to a person's innate skill at programming?
Would be interesting to see this study repeated and controlled for length of carer, ability etc to see if this is a natural or learned trait.
Yes this is a wild over generalisation on skill levels vs natural ability and entirely based in my subjective experiences
1
u/joemaniaci Dec 16 '20
They don't discuss any additional languages so I assume it was only for native English speakers? What about languages like Chinese where everything is a symbol? What if you took an ancient egyptian who read/wrote hieroglyphics natively and taught them to code? "Language" just seems to broad a thing to say when, I'm assuming, only one natively spoken language was used.
1
1
u/TalesT Dec 16 '20
Makes sense. I can listen to podcasts while coding, but not while reading nor writing.
1
u/drea2 Dec 16 '20
Anecdotal but I was god awful at foreign language classes but I am a pretty good programmer so yeah I don’t think they’re similar at all
1
Dec 16 '20 edited Dec 16 '20
When people say programming "language" I think of it like a math language not a natural language. Never thought of it that way tbh.
1
u/immersiveGamer Dec 16 '20
Haven't read the article or paper yet. But my first thought was "Of course it isn't, I will read code backwards just as often as I read it forwards. Never do that with books."
1
Dec 16 '20
I know this is more abstract that syntax, but isn’t this the purpose of OOP - to mirror how the brain objectifies the world it experiences?
→ More replies (2)
1
u/duck-tective Dec 16 '20
Interesting. I wonder then why, when I'm programming for long periods of time it makes my dyslexia worse. I usually have to wait half an hour after programming to write documentation because otherwise my dyslexia will be really bad.
1
u/dkomega Dec 16 '20
I can relate, I struggle to read books my whole life, I have re read each page. Yet I excel as a programmer and can understand code quickly and have worked professionally as a programmer over 13 years.
Sometimes I wonder if my years of reading code has actually made my reading issues worse.
1
u/ojrask Dec 16 '20
Learning a programming language is more about learning how to build a house with new tools and restrictions and materials, rather than how to use a new language to communicate.
Code is communication, but on a different level than "language".
1
u/Professor226 Dec 16 '20
Millions of years of evolution leads me to treat my computer like it’s a person, decades of coding leads me to treat people like computers.
1
1
1
u/aazav Dec 16 '20
Yup. It's often closer to looking at a bunch of random symbols and trying to make sense out of them.
1
1
1
u/rzwitserloot Dec 16 '20
A long time ago just when Ruby on Rails started its rise to popularity, a fellow programmer tried to convince me by showing me that this is legal in RoR/ActiveSupport:
5.minutesMy fellow programmer was rather charmed by how this matches with english so well.
That (very lightly; it's just one argument after all) convinced me RoR was a bad idea: In english, that makes sense, but Ruby isn't english and if it spent a serious chunk of its syntactic budget on emulating it, I wanted no part of it. minutes(5) sounds more programmer-ese, because 5 is clearly a parameter far more than minutes is, and ruby itself (like most languages) tends to put parameters after the thing it is a parameter for, and rarely in front.
But this paper shows that this rabbit hole ('programming isn't anything like natural language, therefore, "Hey this looks like you can just read it aloud and it makes sense!" is far less useful as a language property than one might think') goes even deeper.
1
u/EternityForest Dec 16 '20
A while back I read somewhere that it was using the same areas as language. I wonder if the different results are actually because your average piece of code has changed to have a far more complex structure, full of nested callbacks and async stuff and the like?
1
1
u/Krikkits Dec 16 '20
Anyone who has ever needed to (or tried to) learn a 2nd language would know it feels different. Coding doesn't feel like a spoken language at all! We also don't use programming languages to express actual sentences, it's to solve problems
1
u/bitlockholmes Dec 16 '20
Makes sense considering it took me a year to get to polyglot in code, but I failed 7th grade Spanish.
1
1
1
1
u/SargeantBubbles Dec 16 '20
They’re not the same at all. Writing code is far closer to writing mathematical proofs than it is to speaking language
1
u/biteater Dec 16 '20
this isn't surprising to me. anecdotal ofc, but as someone that is currently learning another human-language (French) they definitely do not feel like the same thing. programming feels like fitting shapes together without language, and human language is much more subliminal and emotional
1
u/SnikchIsGonnaGetYou Dec 16 '20
I swear my grasp of the English language lessens the more I write code
2
u/haikusbot Dec 16 '20
I swear my grasp of
The English language lessens
The more I write code
- SnikchIsGonnaGetYou
I detect haikus. And sometimes, successfully. Learn more about me.
Opt out of replies: "haikusbot opt out" | Delete my comment: "haikusbot delete"
1
u/zyxzevn Dec 16 '20
Smalltalk is the closest to a normal language.
It would be interesting to test that.
1
u/The_Monocle_Debacle Dec 16 '20
That makes sense, you're parsing it for completely different underlying meaning
1
1
1
u/cbarrick Dec 16 '20
I'm not terribly surprised.
Programming languages are all essentially purely generative languages (context free) while natural languages are transformational generative languages. And all natural languages follow consistent and universal patterns of transformations.
The extra transformational step in natural languages implies that additional cognitive capacities are needed to both generate and understand natural languages compared to programming languages. And the universal nature of the transformations implies that our brain has optimized for very specific patterns in natural language (which again are not present in programming languages).
I'm not surprised that this additional cognitive capacity is handled by the "regions of the brain that are involved in language processing" mentioned in the article, and that reading programming languages does not exercise that area.
While I'm sure this is great news for empirical research in neuroscience, it's totally in line with Chomsky's theory of syntax from decades ago.
1
1
1
Dec 17 '20
Well, it's obvious. Code is (hopefully) clear and distinct. Human language is open for interpretation and can easily be misunderstood depending on how it is read.
1
u/Blatantalize Dec 17 '20 edited Dec 17 '20
I'd also be interested in seeing how learning multiple computer languages compare to learning more than one spoken language.
Python is very different syntactically than other languages but does our brain associate learning other languages (spoken or programmatic) more closely with computer languages or spoken and does this ever change depending on said language
1
u/FAXs_Labs Dec 23 '20
well, i don't know if it's only specific to me but i find computer code more structured but real reading is messy
1
u/knightress_oxhide Dec 16 '20
To the brain, reading the word Blue is not the same as reading the word Red. Mind Blown.
1.7k
u/tinychameleon Dec 16 '20
A cardinal sin of academic reporting: not having a link to the paper itself.
I haven’t fully read the paper, but I skimmed it for participant details:
Python code has 25 participants, 15 of which are women
ScratchJr code has 21 participants, 13 of which are women
All participants recruited from MIT, Tufts University, and the surrounding area (whatever that means)
I do wonder if such a small, localized sample can be representative of the general population, but also if different languages would yield different results.