Why don't people like lisp?

Adam Warner usenet at consulting.net.nz
Sun Oct 19 06:05:10 EDT 2003


Hi David Mertz,

> |I suspect you pasted in validly formatted Python code:
> |Before proceeding to indent it for display:
> 
> Nah... that's not the specific error I made. [...]

OK!

> I found that about 70% of the mistakes I made during playing with
> variations on some (pretty simple) functions were because of misplaced
> parentheses (most of the rest were from a fuzziness about the different
> between strings and symbols; but I think I've worked that out).  I sure
> had to stare a LOT longer at those parens (and do lots of counting on my
> fingers) than I would have had to look at wrongly indented Python code.
> In fact, this much would be true even compared to way back during my
> first few weeks of Python programming.

There is not one single gratuitous parenthesis in Lisp. But there are a
number of special forms and before those become hard coded into the brain
it's confusing. For example, consider LET:

(let ((symbol value))
  ...)

The binding of the symbol to the value is nested within another set
of parentheses because LET handles multiple bindings:

(let ((symbol1 value1)
      (symbol2 value2))
  ...)

There is another less commonly used variation of LET that binds every
symbol to NIL, i.e.:

(let (symbol1 symbol2)
  ...)

Is shorthand for:

(let ((symbol1 nil)
      (symbol2 nil))
  ...)

After one internalises _why_ each parenthesis is included everything falls
into place. Before that point the parentheses feel like line noise instead
of critical structure. The next step comes with automatic (re-)indentation
of code. To see a fault in a program one can just look at the indentation.
It's at this final point that the parentheses fade from consciousness
(incorrect indentation indicates a problem!)

Code may be slightly more verbose because of the parentheses but they also
encode some of the information required to reconstruct the formatting
of the code. Not having to manually reformat a function (I just press
C-M-q) is a big win.

As this reply was solely about (Common) Lisp I've set the followup-to
comp.lang.lisp only. But I also replied to comp.lang.python so you could
see my reply.

> But maybe that error will go away over time.  I have some doubts, but
> also an open mind.

Everyone begins with doubts about Lisp, and the doubts easily intensify
before there is any obvious payback.

Regards,
Adam




More information about the Python-list mailing list