One of the things I do when teaching beginning front-end development is ask students to describe what it’s like to read HTML. I give them pretty basic markup for a long-form article, and ask them to read it twice: first in the code, then on the front end.
The #1 common response I hear? It’s like learning a new language.
Of course it is, I tell them. It’s in the name: Hypertext Markup Language. So, I advise them to start treating the materials in the course like they’re learning French, Spanish, or any other language.
Then I wake up this morning and see this MIT study that reading computer code is not the same as reading language, even though they share similarities.
In spite of those similarities, MIT neuroscientists have found that reading computer code does not activate the regions of the brain that are involved in language processing. Instead, it activates a distributed network called the multiple demand network, which is also recruited for complex cognitive tasks such as solving math problems or crossword puzzles.
Duh, you might say. But wait, reading code actually appears to activate additional parts of the multiple demand network that make the task more or a near-match to mathematical reasoning than the exact same thing.
The MIT team found that reading computer code appears to activate both the left and right sides of the multiple demand network […]. This finding goes against the hypothesis that math and coding rely on the same brain mechanisms.
So, back to my HTML reading assignment. Is it better to teach code as a language for recognizing symbols that communicate to the browser what to do, or as a math skill that’s based on solving problems?
The answer is 🤷♂️.
The most interesting thing about the study to me is not how to teach code, but rather how I work with it. Chris always says a front-end developer is aware, and the fact that reading code taps on a region of the brain that’s responsible for handling multi-tasking and holding lots of information only supports that. It also explains why I personally get annoyed when I’m pulled away from my code or distracted from it—it’s like my brain has to drop all the plates it was balancing to pay attention to something else, then pick up and reassemble all the pieces before I can jump back in to what I was doing.
I think the reasoning is because language flows in one direction and programming you have to go in and out of functions. The different flow makes it more like a puzzle when figuring out what something does rather than just interpreting what you are told in order.
I love the opinions here and can certainly agree. I can read language and math as equally easily as reading true crime novels.
I think it’s still best to think of code primarily as a language. While there’s certainly a strong element of mathematical reasoning involved, a programmer needs to communicate that mathematical reasoning, as well as all the business logic to both the computer and (for the most part) other developers.
Mathematical reasoning is crucial, but it’s generally something that for a given problem has to be done once, where as most code has to be read several times.
I think teaching coding, and teaching algorithms is two different things. For the latter, I’d definitely focus more on mathematical reasoning.
Well, sort of. I believe language contains functions but we don’t recognise them as such. Take ‘laser’ or ‘ABS’ or ‘cloud store’; what are these but placeholders for big piles of meaning that we use in the same way a program uses a function? We take complexity and bundle it up as a new word with appropriate properties, behaviors and syntax.
My subversive view is that if a computing strategy can be expressed in English it should be, and computers can damn well learn to keep up. If it can’t, then it’s too complex and needs a new addition to the language.
Math or Language to me are intuitively different from software development. I have dyscalculia and solving for UI doesn’t run me into the same walls as a math problem.
It’s more like Legos, Sudoku and a Crossword at the same time.
I think that depends on the problem that you’re solving. Functional mathematics is quite helpful to better understand functional programming. Discrete mathematics is helpful too. So are algorithms for traversing unknown payloads for generic processing logic. I’ve encountered complex problems on both the front and back end.
I love this. That explains why I’m so in love with this discipline. It’s both art and science.
I think the article was talking about math, not science!
Explains why aspies are made for this kind of work.
I’d say in case of the language it depends on the message your brain is handling. It’s not the same being able to order a haircut in French barbershop and to decrypt a text from Claude Lévi-Strauss.
That last part… “it’s like my brain has to drop all the plates it was balancing “. This describes my experience exactly. It takes me a little while to “warm up” and if I step away for lo her than a bathroom break its like I have to reassemble something in my head before I can make forward progress again. Nothing besides stock market gets me this interested or excited for Monday morning!
I totally get it. I can actually think faster and more efficiently when I code, than say, when I do my maths homework…
These things are fascinating! I would say that reading computer code is not just reading language. Certainly, reading code relies on linguistic attributes of tokens, syntax, and grammar… even idioms, some of which bear no relation to spoken language. Reading mathematical expressions relies on syntax and symbols, as well.
However, when we read language, we reason about systems in the abstract or visualize story worlds, which is actually something the brain does quite readily. Those of us that don’t have aphantasia can picture environments or scenarios we’re not currently in or experiencing. We conjure new imagery or understandings from the assembly of fragments of our lived experience.
The difference with computer code is that, when we read it, we actually have to effectively run it in our mind as we’re reading it. We have to mentally apply the same logic and rules and procedure to interpret it as does the computer. I suppose the equivalent would be like reading a novel and actually having to live the experience of the characters, not just visualize the story we’re being told.
IMO – As someone who suffers from ADD – oh look squirrel – the process of learning takes a back seat to “ability & capacity.”
When you consider the statistics of people who are able to code, its clear to me, that none of us operate within any “norms.”
Majority of high capacity higher retention individuals have some sort of “social” disorder due to high brain functions.
I highly recommend the book Master & Emmisary which delves into hemispheric phenomenology.
It’s fascinating AF!
I read this article! I hope you will continue to have such articles to share with everyone! thank you!
I’ll give you yet another perspective. I work as a developer but my academic studies were in Historical Music. As a musician I’m used to read and play around 5 centuries of different styles and ways of writing music… For me decoding a sheet music and decoding a piece of code are very similar processes! Because, as the study shows, they are global processes in the brain.
But I also speak 5 (human) languages, and I always make the comparison with music/code to languages because we are always using convention of symbols and sound to transmit a meaning, like I can read C code or Swift/Python, but because I don’t use it writing and expressing myself on it it’s almost impossible without learning and dedication. It’s the same for Dutch or German, I can see a text and grasp the gist of it, but those are languages I cannot speak.
Scientifically language and code use different process in the brain, but I think we can argue that the ways to learn both proficiently involves the same path/steps. I only taught music, not code, and always make the bridge with language because it’s something more close to people, so I’ll probably do the same for Code, comparing one thing to another doesn’t mean they are the same .
I like Liz comment, code is both math and art. it’s logical and creative process. Like music.
This explains why I get so mad when I’m in the middle of coding and l have to shutdown in the evening, hahaha…
I am curious on what this means for large sections of comments in code.
I think it’s ok to teach HTML as a language because it uses markups and there is not much logic to it. On the other hand while teaching JavaScript it should be taught as math skill.
100% agree
So it’s not just me. It is irritating when I am coding and my wife comes in to the room to tell me what her sister said about the cousin they don’t like.
I don’t really consider html to be code, but I get the point. For html, I visualize what it’s saying. For code like c# or Java, I look at data flow and almost read it as if I were running different simultaneous tests in my head as to to what it’s doing and what the expected outcome would be. It’s almost like your brain compiles the code to understand what it is doing.
An intern asked me why we dont use divs anymore and one of the things i told him was that if i read his code with semantic HTML i can draw a clear picture of the site in my head while using divs would lead to me picturing 5 unfinished versions and probably i would go back and read earlier lines to remember in what places an element would fall.
And that this is the same reason why he should think of how declare functions and variables in javascript
My wife recognised this in me!
“I personally get annoyed when I’m pulled away from my code or distracted from it—it’s like my brain has to drop all the plates it was balancing to pay attention to something else, then pick up and reassemble all the pieces before I can jump back in to what I was doing.”
I think the first part of learning to code is similar to learning a language. Learning the semantics which characters mean what in what context. This what how to do something. There is still the question of when to do something and how to combine multiple things to get different results. That is the more math/puzzle-like part.
After reading their abstract, I’m not surprised they didn’t see the language parts of the brain light up. They structured the questions in such a way that there would be very little reason for them to do so.
They didn’t ask the participants to formulate a thought in code, they asked them to take preexisting code, and ask what the output is.
They asked them not to produce the code, but to execute it.
They were not using code to fulfil the use of language which is to take your brain state and translate it into a message that others can interpret. They were only on the decoding side of things.
It’d sort of be like expecting that a viewer of a painting would use the same parts of the brain as a painter painting the painting.
In my experience, it makes the most sense to view coding as a craft comparable to metal work or carpentry.
Instead of machine parts or furniture, we produce software which is a very concrete thing.
I sometimes hear the argument that a programmer has to “express their thoughts in terms of a programming language” and hence, programming languages are languages.
Though when you speak a foreign language, say, Mandarin Chinese, you don’t enter a radically different paradigm of thought. There are no variables to declare when you speak Mandarin. You also won’t call any functions you previously implemented. Sure, there are many things you’d express differently in Mandarin as you would in English, but in the end, when you’re having a conversation, by and large the semantic concepts are similar enough.
In language learning, skills like listening to speakers and understanding them in real time are much more important. While you can work on a bit of code for weeks and months, language has to be immediate.
I was fortunate enough to having had both metal work lessons and English lessons at school. I assure you that the two are being taught very differently.
I’m a behavioral neurologist. My n=1 says this is not so clear cut. I saw a former computer engineer with semantic knowledge loss (left temporal pole) and he has lost the ability to understand certain syntax and commands in computer languages he used to know (in
addition to things in English). Logicall processes make sense to him, he can give an overall sense of how codes are supposed to run, math and other aspects of executive function are intact, so this is very much a language issue for him. Computer languages are relatively new in the last 50 years, so as the first generation of programmers get older and some go on to develop neurodegenerative diseases I suspect we will see more of them in clinic and understand more how the brain processes artificial languages.
Use both skill for a better understanding and through reps it becomes easier.
I’m not a coder, but I appreciate you articulating what many INTPs experience regularly — the interrupted plate balancing phenomenon. Thank you.
Author oversimplifies the findings. This is a small and not yet independently verified study on the difficult field of neurology. I recommend people read the study before they change any world views
https://elifesciences.org/articles/58906#s4
In particular
“Of course, the lack of consistent language system engagement in code comprehension does not mean that the mechanisms underlying language and code processing are completely different. It is possible that both language and MD regions have similarly organized neural circuits that allow them to process combinatorial input or map between a symbol and the concept it refers to.”
Science reporters put far too much weight in the importance of “regions of activity” because that’s one of the only windows we have into the brain.