As someone who is fluently bilingual and speaks a third language and is also proficient or better in a half dozen programming languages along with having written code in many more, this is completely obvious to me. Learning a programming language is much closer to learning a complex board game than it is a natural language.
As a total monoglot who regrets not learning languages properly when he was a kid, this still seems pretty obvious to me that at least I don't read code in the way I read natural language, or maths. However it's always good to have intuitions like this confirmed or refuted by actual investigation, and putting them on a more solid footing within the broader context. My personal experience of reading code has always fe…
To the brain, reading computer code is not the same as reading language
171–180 of 232 posts
Re: To the brain, reading computer code is not the same as reading language
#172Earlier quoted context omitted.
This is also why visual low-code programming might actually succeed: it's closer to how you think about code than the actual code. It has the opportunity to visualize the structures you want to see, so you don't have to make that translation yourself.
Visual low-code programming sounds good until you try to express actually non-trivial stuff in it, and you start appreciating text-based flow control again.
Re: To the brain, reading computer code is not the same as reading language
#173Earlier quoted context omitted.
I feel exactly the same, I've been learning a second language and it's nothing like learning programming, in fact arguably the opposite, I've found that obsessing over grammar is almost detrimental to making progress with a new language. The confident students who aren't concerned with getting all the specifics of grammar exactly perfect are the ones that are making the most progress toward being conversational, they…
Weirdly I make the same observation as you about second languages and detail in grammar, but I came to the opposite conclusion. I thought natural language and computer language were pretty similar. One issue in the study is what a reasonable comparison is. Our ancestors would have talked about "there is a lion over there" and such mundane things all the time, so we shouldn't be surprised if we're just "nexting" those…
Now that said, the idea of comparing programming languages with natural languages or even constructed languages seems very strange to me. Natural languages are tools for thought, expression and communication. Programming languages are tools for, well, programming. Even the relationship between the grammar of a PL and the grammar of a human language is distant (we often intuitively think of identifiers as similar to nouns and verbs in human languages, but in fact all identifiers are equivalent to proper nouns in human languages, and the actual equivalents of nouns and verbs are stuff like block openers, significant white space, function application, maybe the keywords).
It is a well-known fact already that humans can only naturally learn human languages, which have a specific kind of grammar. Even some clumsy attempts at standardizing human language end up introducing un-natural grammar that children can't pick up until later in school when it is drilled into them. It would have been truly surprising to find out that we can use our natural language capacity for something as alien as a PL.
Re: To the brain, reading computer code is not the same as reading language
#174And yet natural language aptitude highly predicts programming ability[0] [0] https://cacm.acm.org/careers/243179-forget-math-language-ski...
>And yet natural language aptitude highly predicts programming ability Its all correlated with g. >[0] They contrast "language learning ability", ie intrinsic intelligence, with "math knowledge", ie amount of schooling. For reference, you can take (a version of) the math knowledge test used here: https://www.idrlabs.com/numeracy/test.php If the article wanted to give a more honest interpretation of the paper, they wo…
I saw a paper that argues that there are two factors: g and math. But that's tangential.
Re: To the brain, reading computer code is not the same as reading language
#175Earlier quoted context omitted.
I feel exactly the same, I've been learning a second language and it's nothing like learning programming, in fact arguably the opposite, I've found that obsessing over grammar is almost detrimental to making progress with a new language. The confident students who aren't concerned with getting all the specifics of grammar exactly perfect are the ones that are making the most progress toward being conversational, they…
Interesting. I feel like coding is not that dissimilar. In the early phases of learning a new coding language, I learn how to write lines of code. Sometimes it compiles, most of the time it would cause errors. At some point it works, but a more seasoned engineer could easily find places to refactor it in order to make it more extensible/flexible, easier to read, less brittle, and most importantly to this discussion o…
Of course, you also need to learn large amounts of library functions and their semantics, but that's more like learning who the people at court are and what their roles are than like the language. You could speak perfect French, but you still have to learn that you must call the Comptesse de Barry before calling the King if you don't want her to be upset. Even patterns are often more in this area of cultural/local context rather than the actual langauge - more like learning the difference between overly-descriptive prose and good prose is (which is why the knowledge about it also tends to translate better between different languages).
Re: To the brain, reading computer code is not the same as reading language
#176Earlier quoted context omitted.
I like that example of "learning a board game." When I read text I "hear" conversations, and when I read code I "see" structures. Definitely different parts of the brain being activated.
This is also why visual low-code programming might actually succeed: it's closer to how you think about code than the actual code. It has the opportunity to visualize the structures you want to see, so you don't have to make that translation yourself.
YMMV, but the way I reason through while I read/write/troubleshoot code are mentally visualized and mapped in very different ways. When I compare what I visualize with the junior engineers I support, their visualizations tend to stop at a much higher granularity level. I strongly suspect that I engage in techniques that would be extremely familiar with and be on far more elementary level to those who practiced building "memory palaces" [1].
I have tried to teach this to the junior engineers, but the vast majority are simply wired differently it seems, and the few who "get it" do not sufficiently make it a habit to internalize it, much of which at first involves tedious pencil and paper.
I remember as a kid while blundering about a PDP-8 drawing on paper what I thought was going on at first with labeled boxes and lines (most of which was laughably inept and naive), then gradually transferring that to memory. Over many years of practicing that, it eventually became a reflexive habit. For more difficult problems I encounter today, I still sit down with pencil and paper and diagram it out to talk myself through it and build up a mental model.
For me personally, engaging spatial, motor, visual, verbal, and auditory senses together makes up my "visualization" in an iterative process that gradually internalizes into a pure mental model. That's why I prefer to look like a mental patient in the confines of my private office than at a co-working space or coffee shop.
Re: To the brain, reading computer code is not the same as reading language
#177Earlier quoted context omitted.
I feel exactly the same, I've been learning a second language and it's nothing like learning programming, in fact arguably the opposite, I've found that obsessing over grammar is almost detrimental to making progress with a new language. The confident students who aren't concerned with getting all the specifics of grammar exactly perfect are the ones that are making the most progress toward being conversational, they…
That attitude is actually how I program—with scripted languages I write code and see what happens, if it didn’t work I write it again. I’m relearning C++ now and am doing it a similar way (albeit I have to be a little more careful because compilation makes it a lot slower). At one point, I wondered if this same strategy would make for a good (human) language learning app. Kind of like you described... rather than som…
This is an incredibly harmful attitude towards learning, but it feels nice because it's a lot less effort than actually trying to read or listen to something to learn. It's just laziness.
Learning C++ this way is how someone would end up with a buffer overflow every 30 lines of code they write. It's the reason some self-taught developers can't give you the fuzziest definition of the difference between O(n) and O(n^2).
The closest approximation of this is how kids learn to speak, but this is incredibly inefficient, and they receive many years of formal education anyway.
Re: To the brain, reading computer code is not the same as reading language
#178Re: To the brain, reading computer code is not the same as reading language
#179It's only briefly mentioned, but learning to read music is quite similar in terms of brain function to learning programming. It's symbolic, logical and structured. My university went so far as to allow students with a bachelor's degree in music to directly enter the computer science master's program.
Re: To the brain, reading computer code is not the same as reading language
#180As someone who is fluently bilingual and speaks a third language and is also proficient or better in a half dozen programming languages along with having written code in many more, this is completely obvious to me. Learning a programming language is much closer to learning a complex board game than it is a natural language.
Your comment is insightful and suggests that perhaps we should try to design a programming language that feels more like a natural language.
Ruby’s syntax does seem to be informed by Japanese word order, so that’s nice.