Lisp is worth learning for the profound enlightenment experience you will have when you finally get it; that experience will make you a better programmer for the rest of your days, even if you never actually use Lisp itself a lot. [Eric S. Raymond]
I, for one, know that I’m only partially enlightened.
When I was taking “Programming Languages” (COP 4020), one of the languages covered, intended to represent the entirety of functional programming, was Common Lisp. We studied it for about two weeks. On the exam, a 5-point question asked us to write a function to determine whether a list was palindromic. I set off writing tons of code (on paper, even), checking for the equality of the first and last elements, then stripping them off and recursing on the rest.
As I handed in my exam, I commented on the difficulty of that question compared to the low point value. The professor looked at my test, then at me, and then she wrote on a scrap of paper so that the other students couldn’t see (yet):
(defun is-a-palindrome (lst) (equal lst (reverse lst)))
That’s thinking functionally. I could hammer out the code, but I was writing C with a bunch of parentheses. I wasn’t really writing in Lisp.
When I started working here, I was writing a lot of Python. Python isn’t generally considered a functional language, but it has enough of the features (first class functions, lists, map/filter/reduce, etc) to give me a taste of power. Then I was forced into using VB.NET 2005, which felt like stepping back in time a decade. It had none of the Pythony goodness I was used to: no list comprehensions, no map/filter/reduce (with clunky forms added in VB 2008), and no lambda statements (halfassedly added in 2008 and properly added, supposedly, in 2010).
What skill I picked up from Python quickly began to fade.
My outlook was bleak, as well. I thought the .NET platform was headed for the same old languages and the same old paradigms, for the same old Blub coders. I was afraid that I’d end up a Blub coder… or worse, that I already was one.
Then I saw some of the nice features of C# in .NET 3.5 (and immediately started griping that VB didn’t have them), and what’s more, I found F#.
Let me say this up front: I like Lisp. Most of it makes very little sense to me, but I can feel the power behind it. Though I’ve wanted to learn a functional language for a while now, I know that my chances of ever getting a job writing it are slim, so I’ve focused on the standard OO and procedural languages. F# has the advantage of being backed by Microsoft; Visual Studio 2010 will have F# out of the box, and it’ll be right there on the desks of almost every .NET programmer, overcoming much of the inertia that leads people to use languages like VB.
So that’s why I’ve decided to throw myself into F#; it’s a paradigm I want to embrace, and a language that I may actually get paid to use someday. That’s worth reshaping my mind for.
And at the very least, I’ll end up writing better code in other languages.