Why is it customary to put many closing parentheses on one line in Lisp-based languages?

后端 未结 8 1199
野的像风
野的像风 2021-02-05 01:19

Usually code looks like this:

(one-thing
    (another-thing arg1 (f arg5 r))
    (another-thing arg1 (f arg5 r)))

Why doesn\'t it like this?:

8条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-05 01:42

    Do what you like! It's your code.

    That said, you'll probably eventually move them all back so that you can get more stuff on the screen at once. It really is true that you effectively stop seeing the brackets after a while.

    Actually, it's a bit worse than that. These days when I try to use beloved python, it feels like my code isn't securely tied together without its brackets and I worry that it might fall apart at any moment.

    Hell, record a couple of keyboard macros to swap the whole file from one style to the other. (And learn how to make your version control ignore whitespace-only changes. :-)

提交回复
热议问题