In the spirit of my last post, I decided to turn one of my favorite long comments on Hacker News into a blog post in the hopes that someone would find it useful. There was a good discussion last week about how to learn Lisp, and since I was a little late to the thread, most of the things I wanted to say had already been said. So, in an effort to pull it all together, I made a nice long summary comment, which is reproduced and cleaned up below.
Before I started learning Lisp, I have (in reverse chronological order) worked with .Net for several years, disliked C++ in college, loved Pascal in high school, dabbled in (Assembly?) programming my TI-82 graphing calculator, and started with Hypercard. Here’s my advice based on ~1 year of part-time Lisp education.
- To learn “lispiness”, functional programming, and get a feel for the computational approach to programming, read The Little Schemer and The Seasoned Schemer. Also, use the resources for the MIT Intro course Structure and Interpretation of Computer Programs. Watch the video lectures (30 well spent hours) and if you’re ambitions, read the book (Amazon). Doing these things will help keep you from writing PHP in Lisp.
- To put it into practical perspective and learn the nuts and bolts of modern common Lisp, read Practical Common Lisp (Amazon).
- If you read PCL, you will run into Emacs and SLIME (the generally preferred [NO FLAMES, PLEASE. I KNOW VI IS AWESOME TOO] open source way to edit Lisp files). I wrote some resources to help with that:
- I’m surprised no one has mentioned PAIP (Peter Norvig’s Paradigms of Artificial Intelligence Programming). Probably because there’s no free version online and it’s a pricey book. I got it for myself for Christmas and it’s well worth the price. It’s half AI book, half tutorial on Lisp programming and Lisp style. It’s a good read with lots of example programs written in good Lisp Style.
There are three hurdles people usually run into when learning Lisp:
- The language looks different – this goes away with practice and familiarity. It starts looking normal fast. The parentheses are a bit tough to manage unless you use a capable editor, which leads to:
- Emacs is different – really powerful, fun to use, but it takes investment in learning. It’s really tempting to quit when starting, but worth getting over the hump. Once you do that:
- The way of thinking is different in Lisp – Lisp seems a little awkward to use until you get (don’t need to master them, just get the idea) the following ideas: 1) code can be manipulated as data because the syntax is so simple, 2) creating your own syntax (using macros – code that writes code) means that you can express your program in a way that closely matches the problem you’re trying to solve. Some good articles to help get these points are:
Don’t worry if you don’t get these “big picture” things at first, they click at some point and everything makes a lot more sense. You can speed that up by putting a lot more Lisp in your head in the meantime.
Does anyone have any more tips on learning Lisp?