2007-10-24 / 12:55 /

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:

  1. Easy to choose and install tools
  2. Simple programs are simple to write (& useful)
  3. 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!