Why Lisp's Parentheses Are Harder to Read Than You Think
What makes Lisp difficult to read?
Lisp's parenthesis-heavy syntax has long been blamed for its perceived unreadability, often dismissed as a matter of familiarity. But cognitive science suggests deeper reasons: the Gestalt law of proximity, the limits of working memory, and the visual distance between matching parentheses all make Lisp notation harder to parse. This analysis explains why C-style syntax, with its varied delimiters and closer parentheses, feels more natural—and what that means for designing readable languages.
The Lisp-snippet requires remembering the opening parenthesis until the closing parenthesis comes into focus.
- pfdietz
Lisp isn't difficult to read, so I don't understand the question.
This feels like someone who doesn't know French asking "what makes French difficult to read?"
- tombert
I'll repeat what other people here have been saying: I don't think Lisp is actually "hard" to read, in any objective sense.
It's "difficult" to read because it's different that other languages, but I think some of those differences actually improve readability once you understand the language. The forced use of parentheses everywhere guarantees that precedence is never ambiguous, for example.
- lukaszkorecki
It's the same thing that makes reading Swift code hard if you never worked with it: lack of familiarity.
- groundzeros2015
Unfamiliarity.
- whartung
The parentheses are large glyphs that distract the eye, and do not stand out (to the untrained eye) as delimiters.
Consider:
(defun split-line (line)
(remove-if #'(lambda (word) (string= word ""))
(split-sequence:split-sequence #\Space line)))
Now imagine if we had some "lower weight" glyph besides the paren.
.defun split-line .line,
.remove-if #'.lambda .word, .string= word "",,
.split-sequence:split-sequence #\Space line,,,
Obviously a contrived example replacing () with ., but you can see how "heavy" the parens and how they can dominate what the eye sees.
With experience, the parens vanish. The parens being large and common take control of the conversation more than they should.