[erlang-questions] "Erlang as a First Language" -- crazy? or just stupid?

Joe Armstrong <>
Mon Dec 21 10:15:45 CET 2009


On Mon, Dec 21, 2009 at 1:55 AM, Jarrod Roberson <> wrote:
> Actually Erlang as a first language is not that bad of an idea, especially
> if the only thing the person will ever support is that one application.
> Erlang is hard to learn for people coming from imperative C based syntax
> languages and especially those with decades of experience.
> 20 years of doing something a particular way is hard to UN-learn.

How do you know Erlang is hard to learn - what evidence do you have
for this statement?

I have taught Erlang to a few hundred people, mostly with a C background.
My experience was that my pupils did not find it hard to learn.

In my experience I find that programmers are good in all languages or non.
A good C programmer will become a good Erlang programmer or a good
python programmer ...
A bad C programmer will become a bad Erlang programmer and so on ...
(this is actually a gross
over-generalization, but is not bad as a first-order approximation of the truth)

Having taught Erlang many times the stuff that is hard to learn is the
details of the syntax - specifically getting the commas right, mixing
up atoms with
variables - but this is the same in *every* language - get the odd
semicolon wrong in javascript
and you can stare at the program for hours wondering what is wrong.

On the other hand the *concepts* - immutable variables, pattern
matching, as so on are
easily grasped - people don't have problems here.

People do have a problem with using processes, links and the
philosophy of error handling
since these concept do not exist (or are very primitive) in languages
like C - this is the area
where experience helps.

As regards teaching beginners, it depends what kind of programs these
beginners want to write.

If you target a particular group of programmers and produce the right
educational material this should be
doable - the current Erlang books are specifically not targeted at
beginners. When I wrote
my book we targeted "A practicing Java programmer" - in fact we tried
the text out on a few
Java programmers to see if we got the level right.

If I were writing a book for intended for complete beginners (ie the
"first language" market) I'd
make it a lot thinner and a lot shorter and miss out loads of details.

My son did a C++ course at school when he was 16/17 ish - to my
amazement the course book didn't
even talk about objects - it was basically a sub-set of the C subset
of C++, with a tiny bit of syntax
tips so you could actually compile your programs.

/Joe




>
> If I had learned Erlang and functional programming first it would have been
> much easier to pickup, and would have made learning other imperative C-ish
> syntax languages "foreign" instead of the other way around.
>
> Lots of people that learn Erlang as a 5th or 6th or more language tend to
> judge the learning curve based on their Previous experience learning other
> languages.
> If you know C, then C++, Java, Python, Ruby, Perl, PHP or whatever is just
> learning a different syntax for the most part. Learning Erlang is also
> having to throw out a lot of stuff you "know" to learn a different paradigm
> of thinking on how to structure your decomposition of a problem into
> functional terms.
>


More information about the erlang-questions mailing list