[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: strategies for learning new languages

This may be obvious, but when learning new languages, having a good
grounding in the theory of programming languages helps tremendously.
Particularly since there's a relatively small set of core concepts, which
most languages simply implement special or degenerate cases of.

If you first learn about some feature that's new to you by learning a
particular language's unique implementation of it, you're likely to end up
with a rather skewed understanding of that feature.  A good example of this
would be C++ templates, which may not be the best way to first encounter
parametric polymorphism (speaking from firsthand experience :)  Whereas, if
you already know what parametric polymorphism is, what it's good for, and
how it's used, then when you come across templates in C++, all you have to
learn about are what particular quirks and limitations C++ imposes on the

Academic papers on PL theory rely heavily on the ability to describe
languages in terms of small sets of well-known core features.  For example,
a denotional semantics description of a programming language essentially
boils down to expressing the semantic features of a particular language in
terms of nothing but function calls, along with a small set of operations
and data types - i.e., an augmented lambda calculus.  (I'm expediently
ignoring philosophical characterizations about how denotations map features
of a language into an abstract mathematical space of meanings.)

This is a big reason that we hear so much about closures and continuations:
because they're two of the core constructs which formal descriptions of
programming languages tend to rely on.  It's also one reason Scheme has such
a presence in (good) university PL courses: it's the closest useful language
to the lambda calculus, and lambda calculus is a simple, useful, and
powerful formalism for expressing and understanding computation.

So, to be able to learn new languages more easily, make sure you have some
familiarity with lambda calculus and its application to programming
languages, for a start.  (Lambda, the ultimate study aid?)  For bonus
points, become reasonably familiar with Scheme.  Of course, that's just a
starting point, but it's a very solid one.

Dan Friedman has an excellent, very readable paper related to this general
subject which I think has been mentioned here before: "The Role of the Study
of Programming Languages in the Education of a Programmer":

In this paper, Friedman mentions that one of his goals as a CS undergrad was
"to learn at least one new language per semester" (this was in 1964), and
how he ultimately ratcheted that up to the point of wanting "to be able to
implement a language per week".  His broader point, though, is that studying
programming language theory helps you be a (much) better programmer.