Lambda the Ultimate

inactiveTopic How Do Linguists Learn Languages
started 1/19/2001; 1:34:09 AM - last post 1/20/2001; 12:35:36 PM
Ehud Lamm - How Do Linguists Learn Languages  blueArrow
1/19/2001; 1:34:09 AM (reads: 656, responses: 3)
How Do Linguists Learn Languages
This thread is on sci.lang, and is about natural languages, but I find some interesting connections to programming languages. How do you learn a new programming language? How many languages do you know well enough to read, but not to code anything complicated? Do you like to read code, like others read literature?
Posted to "" by Ehud Lamm on 1/19/01; 1:35:08 AM

Ehud Lamm - Re: How Do Linguists Learn Languages  blueArrow
1/20/2001; 5:52:31 AM (reads: 656, responses: 0)
For one approach, see this.

Chris Rathman - Re: How Do Linguists Learn Languages  blueArrow
1/20/2001; 7:35:30 AM (reads: 696, responses: 0)
That's a pretty in-depth subject - wish I had time at the moment to do it justice. :-)

How do you learn a new programming language?
I actually have a mental block in learning natural languages other than English. My wife, OTOH, has at one time or another delved in French, Spanish, German, and Latin. Her opinion is that if you learn Latin, it makes learning a whole group of languages easier. I don't know that there's a programming language that fits the description of Latin (I'd hate to think that we should all be studying Algol or Fortran).

Anyhow, the first secret to learning a new programming language is to have sufficient reason to believe that you can learn a new programming language. Any learning process requires you either be naive enuf to think you can do it, or be smart enough to know you can do it. A mental block is a self-fulfilling prophecy.

The second secret to learning a new language is to have motivation. Different people are motivated by different things. I motivate myself through a number of different techniques - such as the simple goal of a specific toy example to be conquered. Be it shapes or 99 bottles. Gives me an easily obtainable goal that provides a simple motivation to learn various things about the language.

A third secret is to try to be somewhat methodical when you approach a language. Find out what are the best books for both learning and reference on the target language. Find out what information is available on the internet (the internet has made learning languages a whole lot easier IMHO). Also, if there's a newsgroup, do some casual reading and find out about the culture behind the language.

A fourth secret is to get the compiler (or interpreter) and install it on your machine. I suppose some people can learn a language by simply reading the manual. But the rest of us require actual experiments before anything registers in the brain. On some languages, getting the compiler up and running is perhaps the biggest feat (I know I've been working on and off again with the TOM compiler to try and get it running with Linux, without any luck). Anyhow, you need some positive feedback such as being able to print out "hello world". Also, take notes while you're doing the simple exercises. Try to develop your own cheat sheets that you can come back to on down the road.

Another secret, if you have time, is to either write a compiler for the language or a translator. I've written a couple of translators and it forces you to try and map languages one to other. You find out real quick about the incompatibilities and the similarities between the languages. Takes a lot of time though.

All that said, the best way of learning a language is perhaps be forced to use the language in order to make a paycheck. Nothing like hunger to focus one's mind. Kind of like being thrown in a foreign country - you soon learn how to ask for simple things like "bring me a beer" or "where's the bano". :-)

How many languages do you know well enough to read, but not to code anything complicated?
Actually, I think programming languages work in the opposite direction. I can write in many more languages than I can read. At any time when writing a program, you are using a subset of the language. When you read a program, you are forced into the subset being used by other programmers. I can, for example, get by writing Perl programs, but danged if I can grok what all those other Perl programmers are doing. (P.S.: This is not necessarily a knock on Perl - my knowledge of the language is just not deep enuf).

Do you like to read code, like others read literature?
Most code on the open market is not worth reading unless you need to extract very specific knowledge. But there are some algorithms that it's actually enjoyable to see how simple things can be expressed - I'm thinking along the lines of Haskell. But like most other programmers on the market, I enjoy creating my own problems rather than inheriting someone elses.

Speaking of which, another way to learn a language is to observe someone who already has mastered the language. Nothing like watching and discussing with a guru to help you focus on what works and what doesn't. The XP people are trying to capture this method with their pair programming.


Oh well, good thing I didn't have time, I suppose - or this would have been a whole lot longer. :-)

andrew cooke - Re: How Do Linguists Learn Languages  blueArrow
1/20/2001; 12:35:36 PM (reads: 674, responses: 0)
I've always thought the best way to learn a new programming language is to need a program. If you want the program enough, and you stick to writing it in the language you want to learn, you'll learn the language.

You might not learn "the right bits" (eg writing imperative code in an impure functional language or C in C++), but my experience is that you notice something on the way through that makes you think. Over time, these odd snippets build into a deeper understanding and you expand into using the langauge "the right way" (any good tool is easiest to use in the way it was intended to be used).

Incidentally, this parallels how I have learnt the only other natural language that I am at all fluent in - I had no particular interest in learning Spanish, but it was pretty much necessary to get on with my partner's mother and grandmother. I started with a vocabulary of words that resembled English words and a single tense, and then slowly improved. The alternative - learning Spanish before using it - seems so odd that I wonder why people use the same approach with computer languages. Maybe because compilers are less tolerant of mistakes?

Incidentally, reading code as text sounds similar to an idea I had in which programs would be reviewed like films.