Learning languages is hard, the environment shouldn’t be
2007-10-24 / 12:55 / dave
The challenge of teaching yourself a programming language
Learning new programming languages
Reg & Abhijit cite reasons why it’s hard to learn a new programming language: new language bends your brain and new languages make you feel like an idiot. Adventures in Forth (part 1) was my intent was to highlight another potential reason: it can be a hurdle just to get the tools working (though mostly it pointed out that I wasn’t Thinking Forth). And once the tools are working, are there good libraries? Code samples? Tutorials? References? Etc.
So–once you’ve decided on a language–what makes the environment hospitable?
- Dominant (reference) implementation: no having to decide between CMUCL and SBCL
- Easy installation: binaries, ports… autoconf/automake maybe
- Fast feedback: interpreter/shell/top-level/REPL
- Language scales down: small example programs are easy
- Good error messages: so you don’t spend hours deciphering stack traces
- Tutorials: or maybe even a screencast?
- Authoritative References: an obvious destination for finding the nits to be picked (e.g. Java)
- Helpful hackers: access to helpful humans (mailing lists, IRC, etc.)
- Example code/code repository: technical inspiration/CPAN
Or to go all meta:
- Easy to choose and install tools
- Simple programs are simple to write (& useful)
- Easy to get help
The “scripting” languages nail all three: from “I’d like to learn Perl/Python/Ruby” to parsing log files is on the order of hours.
HTML also wins: the “environment” comes pre-installed and “view source” gives you lots of examples. On the down-side error reporting is bad to non-existent and it can be hard to find good tutorials. In contrast CSS is hard to write portably (so you have to choose your browser). Javascript is non-portable and fails in mysterious ways.
C, C++ & Java suffer from complexity: lots of tools and lots of cruft for simple apps. But their massive corporate and educational following gives them lots of support (and you might be forced to learn them regardless of their ease).
Haskell installs easily (GHC or Hugs) but simple programs are not useful–unless you are trying to write the Sieve of Eratosthenes–and error messages can be indecipherable. The difference between the top-level and the compiler are annoying.
LISP and Scheme have too many implementations. That’s why all of my LISP knowledge comes from customizing Emacs.
Forth was difficult for me to install, but it’s easy to run simple–but useless–examples. There seem to be lots of tutorials.
And that’s all a language needs to hit it big?
Nope. You also need a compelling use case and some contagious memes. But if you want to Cross the Chasm, making it easy to start using doesn’t hurt.
The most successful recent example I know of is Ruby on Rails. The need for web apps (and the heaps of blog love) drove adoption, but the lack of good alternatives, the easy tutorials (the aforementioned 10 minutes-to-app screencast), and the prodigious online help made it easy for developers to get on board.
UPDATE: Redditor dons pointed to the Haskell simple unix tools and Haskell “blow your mind” one-liners as examples of simple and useful programs. I’m not as excited about the one-liners–they always seem more like games for the experienced hacker–but the unix tools look interesting. Thanks for the link!

I do Lisp programming off-and-on, and I don’t know anybody who’s used CMUCL in the past 5 years. I don’t know anybody who’s even mentioned it in as long, except to say “SBCL, CMUCL … too many implementations!”.
In fact, I’ve also heard several people complain “CPython, Jython …” and “Ruby, JRuby …”. And C and C++ have more compilers than all of these combined (and no “reference” implementation), but nobody ever seems to complain about that.
I find it interesting how Lisp gets singled out for this. If I didn’t know any better, I might say people go out looking for an excuse to not use/like The Language That Will Not Die. Slow? No. Weak? No. Expensive? No. Um, there are 2 open-source implementations! Ha, bad Lisp!
Hi Tim,
Suppose you want to play around with lisp. Googling lisp is not so helpful. which lisp implementation turns up a helpful sounding CLiki page. But instead it’s just a list of twisty little implementations all of them
alikeslightly different.That’s not hypothetical, it’s basically what I did after reading some Paul Graham essays. I think I ended up downloading CMUCL but then decided just to use elisp for tutorials. (Of course then I downloaded GHC and, of all things, three Forth implementations, so maybe my priorities are the problem)
Googling Python is much more fruitful: the first hit takes you to the official website, the second directly to the download page.
That doesn’t mean Python is a better language than lisp, just that’s one less thing to think about when getting started.
Hi Dave,Paul Graham says he uses Scheme and CLISP; so why go looking for other lisps? (http://www.paulgraham.com/lispfaq1.html)
I’m sure the experienced Lisp people have their preferences, but the CLISP repl is quite nice and has fairly understandable error messages, etc. It runs on Windows as well, which is handy sometimes.
I would have thought that Peter Sibel’s Practical Common Lisp would have popped up on your google search. If it had, then the Lisp-in-a-Box all-in-one download would have had you using a nicely set up LISP + Slime + Emacs setup within a matter of minutes.
Regardless of all the other stuff, this would at least get you a lisp to play with and an editor/interface to the language that required zero install shennanigans.
Kel,
Practical Common Lisp (& Paul Graham’s preferences) both showed up, but that just sort of added to my confusion. Though I do get your point that there are good started packages.
Aside: after responding to Tim’s comment I was kind of wondering at my own discrepency: I obsessed over my Lisp choice but was comfortable trying out several Forths. I think it was just experimenting with Forth where as I was considering using Lisp as a main language. Somewhere (I think a newsgroup, no links unfortunately) I’d seen posts complaining about the slight differences in implementations making it hard harder to write libraries.
That didn’t stop me from trying out online tutorials (using elisp), but made me think the choice would be important for daily use. So maybe the problem applies learning the language for production vs. learning for fun.