Live data from Hacker News

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

news.mit.edu

191–200 of 232 posts

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

#191
post #87

Earlier quoted context omitted.

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…

I don't understand this. If your code has wrong syntax it doesn't compile. If wrong grammar you can get very wrong results. But in english you can say "I go store" and it's understandable (which btw, can be a direct translation from several languages)

The people you're talking to are just incredibly intelligent compilers. We could make a compiler that takes something that resembles a for loop and changes it to be correct, but to do so would strip a programmer of the power to make something similar to but not quite a for loop, which would generally be undesirable in a programming language.

"I go store" is reasonably close to correct: you have a subject, predicate, and object and there is one meaning that fits far better than all others. However switch it up to "I store food" and now you have some ambiguity: are you saying you are storing food for later or are you saying you want to go to a grocery store or are you trying to talk about the food you purchased at the store? Again, a human being incredibly intelligent might be able to tell from context, analogous to how someone reviewing a block of code might recognize what a block of code is supposed to be doing, but in general you could expect the interpreter to raise an error, either of the form "bad syntax" or "sorry, I'm not sure what you mean."

If we consider "human languages" like legalese or diplomatic language, where the goal as with programming languages is to limit ambiguity as much as possible while maintaining the speaker's ability to potentially say as many things as possible, syntax becomes very important, and typically it's preferred that the interpreter raise an error rather than try to guess at the speaker's intentions.

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

#192

Earlier quoted context omitted.

Makes total sense. If your grammar is wrong, the compiler will catch you. If your English grammar is wrong, I will catch you. Make progress.

The only time I'm going to correct your grammar if you haven't explicitly asked me to is if there's some ambiguity and you're saying something important for me to know e.g. making a specific request. Otherwise, if I think I get what you're going for, imo you're doing fine. Talking good is mainly useful as a class indicator. One thing I think I've noticed among a lot of people who have lived in English-speaking countr…

For your compiler, everything not stated explicitly is ambiguous and potentially important. Talking good may not be necessary for every day conversation, where the stakes are typically low, but you'd go out of your way to avoid grammar mistakes in something important like a legal contract or a published article. Presumably if someone were talking you through modifying your computer and a single wrong move would brick it, you'd ask for clarification should they say anything even remotely weird.

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

#193

Earlier quoted context omitted.

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

It isn't only guesswork -- there is a lot of reading and researching involved too. I figured that was obvious but perhaps it was not. The point is that it is learning by doing rather than rote memorization and recall. It is easier for me to do something, see the result, and figure out what went wrong if it didn't work. It allows me to understand the function behind something, versus just being told "this is how to do…

The better alternative is just to learn thoroughly and apply knowledge as much as you can. You can explore without guesswork.

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

#194

When I'm coding, I often listen to music, and when I listen to music, I often end up singing along. One thing I've noticed is that I can type out code at the same time I'm singing a song aloud. If I tried to do that while writing English, I'd start typing whatever I'm singing.

I just tested this for myself. I was very surprised when I started writing with my pen what I was singing instead of what I'd intended. I then tried coding and was still able to do that while singing. However, I was also able to type natural language while singing.

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

#195
post #28

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.

Not just writing code; reading code is different too. Often I page thru code, looking around, getting the size and shape of it. I don't read every word; I'm not sure what I am doing but it isn't the same as reading. Absorbing, maybe.

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

#196
The human brain has specialized hardware for encoding and decoding language. That is why even a child can pick it up. No grammar lessons required, just lots and lots of exposure. It is also why speaking and listening are as easy as falling off a log. You put about as much thought into it as you do touch-typing.

Learning a second language, likewise, is best done the same way as the first: through immersion, if you can swing it. The high school student who spent a summer in Mexico came back far more fluent than I was even after three classes in high school and one in college. The plasticity, though, of this area of the brain will decrease over time. It is easiest to pick up a new language before adulthood.

Most people don't appreciate this or don't believe it. For more information, read The Language Instinct, by Steven Pinker.

Programming? Yeah, I guess it spins the CPU more than any specialized chip. I hate how I can't be interrupted while doing it, and for a few moments trying to come out of it, I am in some kind of daze.

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

#197

Earlier quoted context omitted.

It isn't only guesswork -- there is a lot of reading and researching involved too. I figured that was obvious but perhaps it was not. The point is that it is learning by doing rather than rote memorization and recall. It is easier for me to do something, see the result, and figure out what went wrong if it didn't work. It allows me to understand the function behind something, versus just being told "this is how to do…

The better alternative is just to learn thoroughly and apply knowledge as much as you can. You can explore without guesswork.

I have to chorus GP. Learning by doing before I have a great understanding or perhaps sometimes far earlier (of course talking about studies on my own time) makes me think through the how and why more thoroughly partly because there is a tanglible goal of getting the piece of code to function as intended versus a more nebulous guess at having understood or not.

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

#199

Earlier quoted context omitted.

I prefer language to notation because language means to me syntax and semantics, both are important to differentiate say Go and Java

And I myself prefer "notation" because with notation we tend to look at the underlying thing, not the notation :) E.g. there are different notations for chess parties, but their peculiarities are not that important, it's the party that matters.

Given that words like "language" and "notation" both come with a set of expectations, I wonder if APL and similar languages that we might as well call "notation-oriented" would have become more widely adopted if we had used "programming notation"

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

#200

Earlier quoted context omitted.

You are right, that slide is very interesting indeed. I wonder what it is about the different languages that triggers the brain to use different regions?

It's probably noise.

Or it could be a sign that logogram-based writing is handled in a different way than one based on a phonetic alphabet.

https://en.wikipedia.org/wiki/Logogram

Post reply on HN