My problem with Lisp

March 16, 2008

I would like to love Lisp, I really would. But I have a small, shameful problem that gets in the way:

Trying to read Lisp code makes my eyes bleed.

This isn't because I can't stand Lisp itself; it's more because I can't seem to stand the way that the Lisp community has decided to format Lisp code.

(Through some magic process that seems entirely at odds with their fractious nature, the Lisp community seems to have standardize on a code formatting standard to the extent that there doesn't even seem to be a debate about it.)

In thinking about it, I believe that there are several things about the standard way of formatting Lisp code that contribute to my reaction:

  • the Lisp community seems to be strongly against interior blank lines (or other whitespace) in functions. The effect for me is an unrelenting assault of text.

    (One result of this is that it is easy for me to lose my place in the text; when reading, I use the visual patterns created by blank lines as a kind of high-level orientation to home in on my current location.)

  • clauses in things like (if ...) are not indented to the same level.
  • indentation levels are small, so I have to pay close attention to really see an indent or outdent.

    The two of these combine to make it hard for me to absorb the structure of Lisp code by skimming in the way that I'm accustomed to for languages like C and Python. (And yes, I consider two-space indentation in C to be an abomination. I am not fond of the GNU C coding standard.)

  • the S-expression structure of Lisp means that control structures and variable assignments do not stand out; instead everything looks the same and I have to read carefully to grasp what is going on, instead of being able to categorize lines more or less at a glance.

Another way to put it, I think, is that the sameness to me of formatted Lisp code makes it hard for me to follow it unless I pay it a huge amount of careful and slow attention.

Now I find myself wondering if well-honed Lisp people have similar issues when reading C, Python, and so on. Or perhaps recognition of certain things is basically automatic for readers in general, because we've been conditioned to notice blank space and indentation and so on in text in general by years of exposure to written words formatted in a particular, customary way.

Written on 16 March 2008.
« Why accurately counting committed address space is hard
Why I expect more from Solaris »

Page tools: View Source, Add Comment.
Search:
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Sun Mar 16 23:58:30 2008
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.