Wednesday, August 08, 2007

i thought lisp would be fun to learn

There was a point during those early months of our startup when we tried something radical. Steve had been single-handedly building and administering reddit until this point and I wanted to help. Sure, we could discuss the site functionality together and I could whip up some mockups in Photoshop, but when it came time to write the software -- I was back to drawing aliens.

One day, Paul suggested I give Lisp a try.

First, some background:

I'd aced a couple Pascal classes back in high school and started enough Quake2/Half-life clans to know HTML and basic Javascript. I knew enough CSS to be dangerous, but was worthless when it came to cross-browser compliance (I'm looking at you, IE). I'd also taken a couple Java classes at community college and a VisualBasic class at UVA. And that was my "programming experience."

Hopefully you've caught your breath now and cleaned off the coffee/soda you've sprayed on your monitor. Don't let it get in your keyboard.

So, it was with this background that I agreed to give Lisp a try. I wanted to help Steve. And how hard it could it be? You should have seen what a Pascal master I was -- a semicolon-wielding god.

And Paul was quite enthusiastic about it. His confidence was inspiring. Only later did I learn that he was doing it because of a John McCarthy-funded recruitment program. Convert twenty people to Lisp and you get a gold watch.

Anyway, I pulled out my trusty notebook (typically reserved for doodles and bad poetry) and started taking notes.

Steve insisted I use Emacs and he set up my Lisp environment for me. I liked the GNU icon.

To his credit, Steve was uncharacteristically patient ;-) with me as he explained all the keyboard shortcuts that would make my life more efficient -- once I memorized them. In the meantime, it was going to be a frustrated series of sweaty and frantic finger pokes. By the end of that first day, I had filled my first page of notes.

If you look carefully, you can see how that day ended for me.

Needless to say, I didn't become the Lisp superstar (or even mediocre Lisper) I'd hoped to be.

In fact, I gave up quite soon thereafter. But it was for the best; Steve wouldn't have been very productive if he'd been answering my inane Lisp/Emacs questions every ten minutes.

program LIFE_OF_ALEXIS (input, output);
to_do : string;
writeln('What what would like to do today?');
readln( to_do );
if to_do = 'learn Lisp' then
writeln('Just quit now.')
writeln('Don't you have some aliens to be drawing?');


Esteban said...

You may want to give The Little Schemer a try?

innervision said...

To be honest, I think trying to learn LISP as a first language is like trying to reach the moon without learning to fly first.

Something I absolutely hate about LISP is the syntax. There are many languages out there that have almost the same capabilities and a much nicer syntax (OCaml, Haskell, etc.)

jimbokun said...

Interestingly, there is almost nothing about Lisp in this post. It's all about how hard it is to start using Emacs.

Emacs is wonderful. I use it for everything. But as a pre-requisite for someone who wants to just learn Lisp, maybe not so great.

to innervision:

As for the syntax, it's what makes a lot of the cool stuff in Lisp possible that other languages can't match (macros). Without adopting a syntax that resembles Lisp, that is.

Ivan said...

You might want to try watching the videos from the "Structure and Interpretation of Computer Programs" class at MIT

It makes things easier to learn. PG's book is good too.

sgoguen said...

How long did you think it would take you to learn LISP?

Seriously, try learning different languages like FORTH or Tcl to exercise your brain a bit. Tcl is a wonderfully simple language that I believe is a nice stepping block to learning LISP, and FORTH is a good language to help break you of your need to see everything in infix notation.

Try to play with as many languages as you can, but really pay attention to the languages that use a minimalistic syntax like LISP.

Aaron Denney said...

Innervision: How can you possibly say O'caml has a nicer syntax. It's ugly as sin. Lisp, well, it's uniform, which has it's good points, but means it doesn't take advantage of different things to express different semantics.

Haskell is beautiful.

Ceesaxp said...

There's hardly any syntax in LISP, and that's a good thing, actually, for a beginner -- there're only few basic constructs (atoms, lists) and a few conventions (remember to quote things if you are not trying to call them, for example).

It is the ideas behind it that are, at times, difficult to grasp for uninitiated. Procedural languages are easier on humans, since you simply "go and tell computer what you want to do."