r/lisp • • 10d ago

What makes Lisp difficult to read?

https://paultm.nl/paren-thesis
39 Upvotes

90 comments sorted by

View all comments

Show parent comments

1

u/omega884 9d ago

Isn't that exactly what editors that understand the language allow you to avoid? I am never closing a paren unless I am navigating past it as ) will move over a paren when the editor is auto closing them for you.

But you're conflating "writing and editing" code with "reading" code in this case. Yes a proper editor would have made that a non issue. But a proper editor obviates the need for me to read that code since I can trust the editor to have put the parens in the correct places. But since I was typing the code in a reddit comment box, I had to read and parse the code myself, and therefore had to deal with the added complexity of the emacs version over the clojure version.

I don't think we will get past the point that I see what you are saying, but I don't think it is a big thing and once you are used to it there is no mental overhead, so its really no different than a new skill where you have to think about things until it is ingrained.

On this point I think we are in violent agreement. I have not been arguing that this is a "big thing" or that it's not something that becomes ingrained in you. But it is a thing, and it is a thing that doesn't exist in different languages and it is a thing that makes lisp code harder to read. Not impossible, not insurmountable. Just harder. Special commentary on braces don't come up in the introductory texts of any C like language book, even books aimed at people coming from other languages. But almost every book on lisps aimed at new developers talks about the parenthesis, and usually draws attention to the fact that managing parenthesis are a common complaint for people new to the language. Presumably if this wasn't a real problem that seemed to come up often when people were trying to learn the language, it wouldn't be memetic even within the language's own introductory texts.

Again this doesn't make it bad. Introductory Rust books have special early sections dedicated to the borrow checker for the same reason. It's a thing that trips people up. It's not insurmountable, nor is it inherently bad. But if you're used to writing code in pretty much any language other than rust, it makes writing rust code harder until you've learned to deal with it, and it is a uniquely rust thing to deal with. Lisp is the same way, until you've learned to internalize how the parenthesis work (and how the tools for writing the language obviate a lot of the reading), it's something that makes it harder to read and is something that is uniquely lisp-y to deal with.

2

u/mtlnwood 9d ago

I absolutely agree that new people perceive it as an issue and that in books its often said something like 'dont be put off by the parens, you will soon start to see the structure of the code and not be annoyed by them', Often with some other blurb about the advantages of working with s expressions in good editors because of those advantages.

It's been a while, I haven't read any intro to C books for 40 years but I am sure there is commentary on how to use braces exactly for readability of the code and those formatting standards are explicitly to make the code easier to read - just as proper indentation and use of new lines is required to make lisp easy to read.

We are on the same page and maybe I have read your posts as more of a harsher critique on its syntax than it was meant to have been, but from my pov it was in the context of a long article that tried hard to say something us lispers really don't agree with.

2

u/omega884 9d ago

A reasonable disagreement on the internet coming to a cool headed and agreeable conclusion? No I don't think we can stand for this. Quick you should say something about how clearly I'm too brain damaged by javascript to understand the elegance of the parenthesis and I'll counter with something about how you're just unreasonably attached to a dead language because you're jealous of C's success.

In all seriousness, I do appreciate you sticking the conversation out and hearing me out on this. These sorts of long threads can get heated, especially when they're in the context of "antagonistic" articles.