Friday, December 14, 2007

The difficulty of Lisp

An blog post on the difficulty of learning Lisp recently appeared on Reddit, which argued that Lisp was actually not very hard to learn. Unfortunately, to be honest, the reasoning totally sucks.

I think the "Lisp is hard" idea is general bunk. It’s different and looks funny (but, hey, if you can stomach C++, what can’t you take!) but getting started in Lisp is no harder that any other language. In fact, its easier to get started in Lisp than it is in programs that require a separate compilation step.

Of all of the points to argue why Lisp would be easy, this is certainly not a very good place to start. A hello world application indicates nothing about the difficulty on learning a language. Well, almost nothing. Java's hello world is often cited as indication of how difficult it is for some to learn Java, but I don't think the converse applies. I do agree with the author, though. It's going to take a lot of work of some sort to start convincing people otherwise. Mark Guzdial, a long-time teacher now at Georgia Tech, wrote a post about the best paradigm for teaching programming, saying:

Supporters have argued that a functional approach is most like mathematics (and is thus more familiar) and that non-mutable variables lead to more easily maintained software, are easier to understand, and are more likely to be provable. A paper at ESP by Michael Eisenberg and Mitchel Resnick showed how hard functional programming is for students. If the students are comparing functional programming to mathematics, it’s not obvious and even if it’s happening, it’s not clear that it’s helping.

Unfortunately, the article was published in 1987 and isn't even available at ACM's digital library. Funny enough, the five comments at the time of this writing all agree that Lisp is not hard. The general consensus seemed to be that Lisp makes other languages hard, that learning Lisp first would make other languages harder. I find this somewhat difficult to believe, and very subjective at best. It may certainly have an impact (to a degree) on what language you prefer, but as to increasing the difficulty of learning, there probably isn't much research in that area. It's similar but more radical to the debate over whether learning object-oriented programming before procedural programming (Java, C) is better.

Indeed, some of the resistance to learning Lisp is probably FUD of some sorts. It's probably also somewhat related to many universities' reluctance to teach a language that isn't used in the industry, which doesn't use Lisp because universities don't teach it, ad infinitum. However, it's certainly unfair to argue about ease of programming with hello world programs.

2 comments:

root said...

You're thinking about it the wrong way, consider this: Lisp is not significantly different from programming in, say, ruby or python. Many of the things you do in those languages are based off of how you do it in lisp[wikipedia python, ruby]. You've got lambda functions, you've got object orientation (with CLOS); what makes lisp significantly harder to learn than either of these programming languages? Nothing; except maybe macros.

Macros are a different breed and are immensely difficult to start out with; but you don't NEED to use them. What the conclusion should be then is not that lisp is more difficult than these languages which have been designed for ease of use, but rather that it is harder to MASTER.

This brings us to Java. Is Java easier to learn than Ruby or Python? I would say no and I'm sure I could think of a good reason why too, but I really don't believe you'd disagree with me on this one (though I could be wrong).

saiyr said...

Yes, I realize that Python and Ruby share a lot of features that are inherited from Lisp. However, I think the difference is that Lisp is functional first. Even though Python has some functional functionality, so to speak, it's still definitely imperative. The language itself is quite easy to learn sure, but I would argue that learning how to use Lisp "the right way" is probably harder. I would argue the same for any language that seems to be "functional first." Although, I don't actually have much Common Lisp experience myself; the only experience I have is reading through part of The Little Schemer. I didn't find it too difficult, but it is a beginner's book.

No, I definitely wouldn't argue that Java is easier to learn than Ruby or Python. I've posted about Java before, since it's taught at my university. I don't really think Lisp is a very good introductory language due to its nature in being functional first, but once you cross that barrier, then sure, maybe Lisp is a good contender.

My end point was more or less calling the article out on using inadequate reasoning to suggest that learning Lisp is easy. I would be happy to read an article that argued with more than a hello world program.