> humans can’t immediately parse structure with a glance, and sometimes we have to count parentheses by hand.This is why automatic indentation is important when working with Lisp. This is mentioned later in the article, but I consider it mandatory because of the multitude of problem this approach resolves.
For example, upon pasting the below snippet into emacs:
(let* ((foo 10)
(bar (+ foo 32))
(* foo bar))
The editor 1) notifies me that there is a missing paren somewhere, 2) automatically* reindents this code into:
(let* ((foo 10)
(bar (+ foo 32))
(* foo bar))
At this moment, it's obvious that we have three variable bindings, one of them malformed, and the programmer can correct this by planting a missing paren in the proper place. I wrote about this topic at length in
https://mov.im/blog/phoe%40movim.eu/cd3577f6-fb1d-45f5-b881-... before.
* with aggressive-indent and electric-indent enabled in emacs, as soon as the missing paren is placed at the end
This is why automatic indentation is important when working with Lisp. This is mentioned later in the article, but I consider it mandatory because of the multitude of problem this approach resolves.
For example, upon pasting the below snippet into emacs:
The editor 1) notifies me that there is a missing paren somewhere, 2) automatically* reindents this code into: At this moment, it's obvious that we have three variable bindings, one of them malformed, and the programmer can correct this by planting a missing paren in the proper place. I wrote about this topic at length in https://mov.im/blog/phoe%40movim.eu/cd3577f6-fb1d-45f5-b881-... before.* with aggressive-indent and electric-indent enabled in emacs, as soon as the missing paren is placed at the end