Two Essay Collections for the Price of One

One of my business partners gave me a Barnes&Noble gift card for Christmas. Retailers love these gift cards. First, they get to hold onto the money that the gift card represents without the loss of product while the gift card holder leaves the gift card sitting on his desk for a few months as I have. Second, I think I read somewhere that something like fifty percent of all gift cards never even get redeemed, and of course that is pretty much free money. Gotta love free money.

Anyway, I did leave that gift card sitting on my desk for a few weeks while Barnes&Noble racked up interest on the cash it represented. Then while I was cruising around the Internet as well all are wont to do, I ran across this essay about what I’d wish I’d known in high school written by a guy named Paul Graham. It was marvelous, and I poked around the rest of his website and found a lot of good writing. I also found that he had recently published a collection of his essays in a book called Hackers & Painters. Well, that gift card was sitting there, and so after a quick trip to the local Barnes&Noble, I was the proud owner of a copy of Mr. Graham’s book. And then I read it. And now I’m going to write about it.

First, let me start by saying that Graham is clearly a super-smart guy and a very savvy business man. He basically invented the concept of the online e-commerce site, and ended up selling his company to Yahoo for what I am sure was a sum that left him free to do whatever he pleases with his life, like, say, writing and publishing essays. He is the guy that invented the Bayesian filtering technique that most of us now use to help get rid of SPAM emails. He appears not only to be a brilliant programmer, but also an accomplished artist, and the title of his book (it is the title of one of the essays in the book as well) reflects his two disciplines. Graham writes beautifully and thinks clearly, and his essays are a pleasure to read, even when you don’t agree with him.

This collection of essays can really be divided into two parts. The first nine essays cover the general topic of “interesting thoughts about the technological age that we live in.” The first, “Why Nerds are Unpopular” will resonate strongly with anyone who was “brainy” or interested in technology back in high school. Others, like “Hackers and Painter” and “Good Bad Attitude” discuss the notion of “hackers” and the role they play in society and technology. For Graham, a hacker is someone who makes things (much like painters, he points out) and who can make a computer do what he wants. He devotes quite a bit of space to discussing who hackers are, what they do, and why they are the way they are.

In this first section, he also gives a refreshingly insightful view into economics, and why free societies are so productive and innovative. If you want to understand what wealth is, and how to create it, read “How to Make Wealth”. You won’t find a better discussion of the topic in any economics text book. The refreshing part comes when Graham argues the obvious point that wealth only gets created when people are able to keep for themselves the fruit of their work. He points out that the true benefit of allowing people to become rich is not that they will offer you a job (as is commonly pointed out), but that the rich person is far more likely to sell you things like cars and tractors and computers – things that make us all better off. If people aren’t allowed to keep the riches that flow from hard work and innovative thinking, then you end up waiting in line for bread everyday – a point he makes clear in “Mind the Gap”.

It’s all wonderful stuff in the first half. But then we get into the second half, and well, it, uhm, well, it bugged me. The second half can be summed up as the “LISP is the holy grail of programming languages, and if you aren’t doing LISP then you are an idiot” section. At least that is how it came off to me.

Let me say that I don’t know thing one about LISP, other than it uses a lot of parentheses. The only LISP code that I’ve ever seen is the code Graham puts in his book. I’m sure that LISP is a powerful and useful language with lots of neat features. But I’m also quite sure that LISP can’t and doesn’t do a lot of the things that need to be done by us programming geeks. I’ve managed to accomplish quite a bit over the years without LISP, as I am sure many of you have. This is a fact that appears to have escaped Graham.

Graham is so big on LISP because he believes that his use of LISP for building his e-commerce site was the thing that kept him ahead of his competition. LISP apparently allowed Graham and his partner to implement new features more quickly and to match the features of the competition almost before the competition shipped those announced new features. I have no doubt that this is true. However, I have to question whether Graham’s success was due to LISP, or to the fact that he and his partner were just, well, smarter and more diligent than the competition. It seems to me that a better explanation is that they would have been able to do what they did no matter what language they had chosen.

The last six essays in the book are all dedicated to programming languages, including discussions about what a programming language is, what good ones and bad ones are like, and what the “dream” programming language would be like. Not surprisingly, the dream language looks a lot like LISP, and a “good” programming language has a lot in common with – surprise! — LISP.

For instance, Graham argues that LISP is so cool because it has an elegant solution to a problem that he puts forward: “..write a function that generates accumulators – a function that takes a number n, and returns a function that takes another number i.” Well, when I read that, I confess the first thing that pops to my mind is “Write a function that returns a function? Why in the world would I even want to do that?” Now, there is probably a very good reason for wanting to do that if you write LISP, but if you don’t, why would you want to? Discussion follows about how all other languages other than LISP can’t do this elegantly or can’t even do it at all. And of course, at the end of all this, I’m thinking “who cares”? Graham has provided a useless problem that LISP apparently solves well, and then denigrates all other languages for not being LISP. I found the whole discussion irritating. I admit that I’m certainly missing something in the problem, but the fact that I’ve never needed to do what is proposed is quite telling to me.

Of course, as a Delphi programmer, the fact that he wrote this sentence — “At the other end of the continuum are languages like Pascal, models of propriety that are good for teaching and not much else.” — completely undermines any argument he might make. Say what you will about Pascal, but it is good for a lot more than teaching, and the fact that Graham doesn’t know that certainly limits his ability to discuss the utility of the various programming languages out there.

Nevertheless, despite the LISP love-fest, Hackers & Painters is a stimulating and thought-provoking book. When discussing the economics and sociology of the computer age, this book is wonderful. When telling us all how great LISP is, it drags and gets preachy. Graham is a gifted writer, and I have subscribed to his RSS feed in order to keep up with his writings. (Anyway to filter RSS entries for the word LISP?) I look forward to hearing more from Mr. Graham on the topics of economics and the world of geeks and hackers. I’ll probably skip the essays on the wonders of LISP.

2 comments so far

  1. Virgil Dupras
    #1

    Functional programming is without a doubt a very interesting way to solve a problem. And for some problems in particular, it is exceptionnally difficult to get a satisfying result with anything else than a functional language. I tried to participate to the ICFP (International Contest of Function Programming or something like that) last year (http://www.cis.upenn.edu/proj/plclub/contest/index.php) with Delphi, and it was very difficult. And if you look at the results, most participants who didn’t use a language supporting the functional paradigm didn’t achieve very good results.

    I am but a mere beginner with the functional paradigm (python!), but from what I know about it, I can understand why someone would be a lisp elitist.

  2. Jim Cooper
    #2

    While I don’t think LISP is a particularly good example of the breed (it’s a bit like Algol in the sense of being a common ancestor for more modern languages), functional programming languages are incredibly powerful for certain sets of problems. For the things the do, they absolutely crap on procedural languages for ease of use and expressive power. The code to write a parser is about as long as the BNF definition of the language, for instance.

    They are very good at mathematical type problems, which includes a lot of AI techniques (other nonprocedural languages like prolog can be useful there too). Handling lists, trees, queues etc is incredibly natural (and hard to avoid sometimes ). However, there are a few downsides :

    1. Since they’re based on the lambda calculus, there is a new paradigm to learn. Procedural languages are based essentially on how microprocessors work. So you get things like functions being first class citizens of the language (like you mentioned), no variables at all (really!) and so on

    2. They tend to not run very efficiently. Modern languages like Concurrent Clean have solved this problem, but at the expense of many (2 or 3 dozen I think) passes over the source code and syntax tree etc. Modern processors also help, of course.

    3. Side effects are avoided in pure functional languages. However, UI and data storage are pure side effect 🙂 Again, there are ways around this (Clean is a good example)

    4. The apps are almost always highly recursive, and are difficult to debug

    I did functional programming at uni, and it was my favourite of all the programming subjects. It helped form some of my opinions on programming languages and techniques, but sadly I’ve never gotten to write anything major with one, although I’d like to.

    Functional languages are wonderful things, and if you ever wanted to expand your horizons beyond Pascal, this would be a great choice. Pick something like ML, Miranda or Clean though, not LISP!

Leave a Reply

You must be logged in to post a comment.