Comment by CJefferson
8 years ago
In C++, I often use LHS and RHS (left hand side / right hand side). I know other people who like fst, eat (first, rest). Both seem better to me, as they have some meaning other than random made up strings (for people who don't use 704).
> Both seem better to me, as they have some meaning other than random made up strings (for people who don't use 704).
Calling the lefthand child of a node in a binary tree the "first" and the righthand child the "rest" seems like a markedly worse naming system than random made-up names, to me, because the use of English names seems to be implying meaning that it doesn't really offer.
The idea of a thing with two values, one on the left side and one on the right side is probably a bit more intuitive, but I really doubt it's that much moreso than just saying it has two parts called the car and the cdr. People who've never touched a 704 have been learning about conses as a data structure with two parts, a car and a cdr, for almost 60 years; to most of them, it's just vocabulary you learn now, the same way that numerator and denominator are just arbitrary names to people learning fractions.
I also think it's interesting how much people complain about car and cdr yet it's very rare that people complain about cons, which is just as badly named. It should probably have been called make-pair or something, which I think is a much bigger improvement than car vs lhs. But really, it's 3 words of vocabulary, whose definitions can be completely understood by
That's not very much to ask someone to wrap their head around, it was meaningful to the original implementors, and for people now there's about 60 years of precedent for using that terminology.
I feel the better question, and I don't know the answer, is does this kind of thing stop people taking up lisp. Honestly I think it does, for so many languages, the first view, the first 15 minutes of reading, and the first 10 hours are super important, that is when you lose many possible users. It is certainly the points where I often drop languages.
While lisp is old, it's never picked up many users. This is the kind of little thing which makes me not want to teach it (not just this, but just lots of little ways it seems stuck in history).
I think that's more attributable to the fact that for most people, their first 10 hours with Lisp are spent writing recursive functions that explicitly cdr down lists, rather than the names car and cdr. I think it would make a much bigger difference if more people's first exposure to Lisp was something like:
But instead most schools only use Lisp as a vehicle for teaching the basics of recursion and functional programming, rather than as an immediately useful tool, so most students go away with the idea that that's what Lisp is used for, and attribute their difficulty understanding The Little Schemer to difficulty understanding Lisp.
2 replies →
Nothing that was based on garbage collection picked up a lot of users before 1999 or so.
Basically when the world "rebooted" into garbage collected, managed languages, it was amid a sort of Lisp amnesia. A lot of that was due to new people who had no such memory to recall.
Prior to this general movement, there were severe barriers in place against anything memory-managed.
And anyway, even if everyone who had already been programming in 1980 switched to Lisp today, it would be a drop in the bucket.
I think the original Lisp people didn't persevere enough. They peaked early. By the time Java and whatnot came around, the presence wasn't there.