by ajkjk · 8y ago · 0 comments
If the person justifying Lisp doesn't mind that the word 'cons' is terrible, why should I trust their aesthetic sense about anything? If I have to have "miserable notations" to get "coding nirvana", and coding nirvana is so great, why not fix the notations? do you just think everyone should have to struggle because you did?
I guess it feels like trying to determine which of these statements are true: (1) "Lisp is coding nirvana" (2) "Lisp is weird regressive nostalgia for a simpler era where nothing was typed and everyone used Emacs and memorized arcane terminology and shared macros on Usenet", and there are way too many signs that it's a lot of (2).
[edited to be less abrasive]
Like they're really not. "first" and "rest" work just as well as car and cdr.
https://stackoverflow.com/questions/29907440/difference-betw...
"[edited to be less abrasive]"
Keep editing.
It's tricky online to find the right place in between "having opinions" and "never contributing". I have opinions about the Lisp world that aren't that nice but weren't represented in the comment section, so I wanted to throw them in. The opinions are dismissive, so they had to sound a bit dismissive. My first pass was overly dismissive so I edited it but I don't think I want to go more "o please teach me!" than I did because then I'm lying about how I (and I think other people!) feel. Which is, basically, frustrated.
This is not about aesthetics, unless you are arguing that the symbols should be replaced by square brackets or emoji.
And this has been tried before. S-Expressions are not the only way to express lisp. There are M-Expressions and many other notations. Even significant whitespace has been tried.
And yet people keep coming back to parentheses. Don't you think there is a reason for that?
Also: almost all other languages use the exact same convention for lists that Lisp uses (except they tend to use square brackets as their symbol).
The same can be said about older languages like C, which also have standardized notations.
Why fix what isn't broken?
Right...because `caddr' and `caaddr' are good because??? And when is the last time you consciously used any of those primitives?
Renaming stuff every few years dosn't make it easier to learn.
TBH, though, as someone who used to love Scheme (and has yet to spend any real time with Clojure), I agree that there's a hefty amount of nostalgia involved. 2 or 3 decades ago, lisp felt like a total sea change compared to what else was out there, which was mostly just a bunch of C and BASIC dialects. Nowadays even the C dialects have adopted most of what made lisp feel great, and I just don't feel that great a need to go back to living a world where (almost) everything is a linked list.
(All things considered, I don't think that 'for' or 'switch' are any clearer, anyway.)
Ok, so what do you think are better names for those operators and why would they be better?
Do I even need to justify why these are better names? The problem is not that people don't know about better names. Everyone does [0]. My issue is that this doesn't seem to bother people.
[0]: https://www.gnu.org/software/emacs/manual/html_node/eintr/St...
The Lisp practice for 40 years is to use FIRST, REST, LIST, APPEND, LIST*, ... when we speak about List Processing.
CONS, CAR and CDR are used when cons cells are used for things like trees, graphs and other data structures. It's an indicator that the code is very low-level and used for assembling other data structures from cons cells.
I sometimes use cons cells for binary trees - first and rest are misleading in that case. I very often use cons cells to define things - the car is some object and the cdr is some property or definition that applies to the object. first and rest are misleading for that use case.
What you are proposing is to use domain-specific names for operations on an abstract data structure. Any names with pre-existing meaning will become misleading as soon as the data structure is applied to a different application. Coming up with new terminology to unambiguously refer to new technical concepts is not a "problem," it is a means of effective communication.
whyknow thing like word"and"sentence to write and plural and capitalization comma dot semicolon space question mark need write spaces between them wordamabobs
why don't fix notation???
Oh please, cry me a river. Like monads, promises, or props are any better.
> If the person justifying Lisp doesn't mind that the word 'cons' is terrible, why should I trust their aesthetic sense about anything? If I have to have "miserable notations" to get "coding nirvana", and coding nirvana is so great, why not fix the notations? do you just think everyone should have to struggle because you did?
Your ignorance is baffling. The notation is a feature, not a bug. If you want the feature, then yes, you will have to struggle.
While cons and cdr as concepts are necessary to learning what goes underneath the hood, idiomatic lisp is rarely written in terms of cons and cdr.
> Your ignorance is baffling.
That is not acceptable on HN and will get you banned. Please read https://news.ycombinator.com/newsguidelines.html and only post with respect for others.
I agree with you about car, cdr, and Lisp notation—and that strengthens the sentence above. The last thing we want is people arguing for correct positions by being a jerk. By doing so you discredit what's correct and/or legitimize being a jerk—two dreadful outcomes that matter more than someone being wrong (in your view or mine) about car and cdr.
(Monads and props are definitely not better. You won't find me defending them! 'Promise' is a much better name, though.)
Naming is important, but the core Lisp names can be learned in a day.