Ask HN: What makes Lisp hard to learn?
I'm interested in producing educational material on how to use a LISP. What are the major pain points on the learning curve for everyone? Specifically, what's tough to get coming from a Java or C# background?
Share your stories!
8 comments
[ 5.5 ms ] story [ 38.8 ms ] threadThe short answer is to setup SBCL and Slime/Emacs (here's a guide I wrote: http://www.pchristensen.com/blog/articles/installing-sbcl-em... )
A previous discussion on learning Lisp: http://news.ycombinator.com/item?id=125766
Plus another article I wrote: http://www.pchristensen.com/blog/articles/how-to-learn-lisp/
Additional resources:
SLIME/Emacs cheat sheet: http://www.pchristensen.com/blog/articles/public-beta-open-f...
Watch the SLIME movie (http://www.guba.com/watch/3000054867 ) and read my notes on it (http://www.pchristensen.com/blog/articles/reference-for-the-... )
EDIT: To avoid the setup hassle entirely, try Thnake (http://jasonfruit.com/thnake/ ) - a Linux liveCD with SBCL/SLIME/emacs preconfigured, complete with webserver and gui packages.
I don't know if Clojure is a helpful suggestion to the OP but it is certainly a more appealing way for me to get into Lisp than Common Lisp was.
Edit: I have just recently completed the install/build/IDE trifecta myself thanks to ELPA and leiningen but it certainly wasn't a one-day process. One of my biggest problems was reading out of date tutorials rather than the latest and greatest. It can be hard for a newcomer to see a HOWTO blog post from mid 2009 and decide whether or not to try it out.
I'd love to try out clojure, but I want to type something like 'sudo apt-get install clojure-sandbox'.
The biggest thing, I think, is that it's based on expressions rather than statements, which is rather a different model than the Algol family (more or less) languages mentioned above. And for me, learning the importance of indentation for code comprehension, but that had already started with my learning C.
And then there's recursion; you can't do idiomatic LISP without it (The Little Lisper or nowadays Schemer is good for that).
Ideally you'll also learn functional programming; optional in Common Lisp, hard to avoid in Scheme, and there's little point in using Clojure without it.
Frankly, I find it delightfully simple. The conceptual base is small, the syntax of parens, atoms, immediates (e.g. numbers) and special forms (e.g. if) makes is a very regular language, no "cancer of the semi-colon.
It's really quite nifty, and of course back then there was pretty much nothing faster with which to develop software. You mostly just have to unlearn some stuff and be willing to put in some effort, which will be well rewarded.
1) oddly-named functions -- rplaca, cadaddaddr and the like
2) weird "macho" indentation -- more so than the much-maligned parens. I found that at some points of The Little Lisper, I needed a ruler to make sense of the indentation level. I have hopes that the default 4-column indentation in Clojure will make it much easier for me to learn.
3) strange control flow constructs. Trying to make sense where the condition, if and else clauses begin and end in an "if" can be a pain. More so for "cond" or "do". Combine that with 2), and things become unreadable quite fast.
By the way, none of these would be a showstopper if I had to learn Lisp for work or college. Just that, they made it not worth my time to try to learn it for fun.
Edit: I forgot, tail-call recursion. A single misstep and your CPU and memory footprint go from constant to exponential and/or Ackermaniac.