Thread: More languages?
View Single Post
Old Dec 9th, 2005, 7:14 PM   #18
grumpy
Programming Guru
 
grumpy's Avatar
 
Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,260
Rep Power: 5 grumpy will become famous soon enough
Quote:
Originally Posted by Arevos
Even so, it only takes a few weeks at most for an experienced programmer to learn all the syntax of a new language. Now, I might be a little slow, but for a natural language I'd take years to get such a complete grasp of grammatical rules.
There is a difference between an experienced programmer learning the syntax of the language and being able to use it in earnest to solve complex problems.

The learning curve of most programming languages, for someone with experience, tends to be something like (there is some degree of parallelism between these phases);

1) Learn the basic syntax
2) Learn grammar and semantics
3) Learn techniques well enough to be able to do things competently in the new language, but still make mistakes in practice. This is the stage where the programmer initially works by "I do this in this way in <first language>; not to map it to <second language>".
4) Unlearn techniques from previous languages that make things difficult in the new one. This is the stage when one starts learning to solve programmin problems in the new language without thinking initially in the older language.
5) Refine skills in the new language. This is the stage when advanced idioms in the new language are learnt.
6) Achieve complete mastery of the new language.

In your discussion, you are focusing on the first step (and, partially) on the second. It is the last three steps that take the time.

Compare this with the learning curve of a natural language, which goes something like;

1) Learn the basic syntax
2) Learn grammar and semantics
3) Learn expressions and idiosyncracies in the new language, but still (in ones head) have to translate from the first language. This is the reason why a competent german who can speak english will sometimes as "how do I say <german expression> in english?"
4) Unlearn techniques from previous languages that make things difficult in the new one. This is the phase in which a native german speaker learns to speak english without an obvious german accent.
5) Refine skills in the new language. This is when one learns the more difficult parts of the new language (eg colloquialisms, things that don't easily translate into the language the person started with).
6) Achieve complete mastery of the language.

There is a one-to-one mapping between the phases for learning programming languages and learning mapping language. The main difference is that, for learning ones first "natural language" most people will eventually get to step 5. When learning one's first programming language, a lot of people will only get to step 2 or 3, and will assume they have mastery. In effect, however, they have skills comparable with what what they had in their first natural language at the age of 5 or so.

When learning a second natural language, relatively few people get past step 3: which is why native speakers of one language can easily spot people who are speaking it as a second language.

One difference is that most people, even with their first programming language, achieve the equivalent of what a 5 year old would do with the first natural language --- they only get to step 2 or 3. So, when they get to step 2 or 3 in a second language, they incorrectly assume they have mastery; in reality they have not advanced much past the baby-talk stage in either language.

Interestingly enough, a similar sequence comes up when learning music (which a lot of people don't realise is also a language of it's own). In terms of the above steps, a person learning the piano will be able to hit individual keys at step 1, play scales at step 2, basic tunes at step 3, advanced music at step 4, will be a concert pianist when they reach step 5, and will be a composer of the likes of Beethoven or Bach when they reach step 6.

Quote:
Originally Posted by Arevos
I suspect that today it's more due to programming tradition.
Possibly. Most designers of modern languages assume programmers are english speakers (although they don't necessarily assume that english is the first language of the programmer).

Quote:
Originally Posted by Arevos
You're looking at it from a superficial perspective. Whilst the names and symbols may change, the structures underneath are the same. If and While are constructs found in most computer languages; even if they were named Foo and Bar, it would not take long for a programmer to get used to typing Foo in place of If, and Bar in place of While.
As a matter of fact, I'm saying you're looking at it from a superficial perspective because you're focusing only on syntax. Quite a few modern languages support if and while. Relatively few older languages support the notion of while (they do it via a goto).

Syntactic changes are the trivial bit in going from one language to another. Expressing yourself in the new language, in a way that a native speaker in the language can't spot it is your second language, is much more difficult.

Quote:
Originally Posted by Arevos
Likewise, even if you associate assignment with '=' and equality with '==', it's not going to take long before you learn that in BASIC, '=' has both meaning, depending on whether it is inside or outside a boolean condition..
You missed my point. The C code
   if (x = 1)
        something();
always executes something(). While it is true that a C programmer can go quite easily to BASIC with such a test (the BASIC interpreter complains bitterly when it sees "if (x == 1)", the reverse is not true. I've lost count of the number of times I've seen people with a BASIC background learning C, and not understanding why the above code always executes something(). While it is true that a C compiler can often be coerced into giving warnings about such things, such compiler options are only used by people who are advanced enough in their knowledge of C to know there is a pitfall (eg at level 3 in the learning sequence I discussed above).
grumpy is offline   Reply With Quote