4 ms·
Not sure how "seasoned" I am, as the biggest program I've written in CLOS that went live was under 2000 LOC, which doesn't sound like much. In other languages,
by ken 8y ago
Not sure how "seasoned" I am, as the biggest program I've written in CLOS that went live was under 2000 LOC, which doesn't sound like much. In other languages, though, it would have been much longer, due to two factors.
One is that CL seems to encourage writing everything in CL, so it's easy for library authors to expose everything (like their intermediate AST) to callers. That helps reduce redundancy. In other languages, what I often need is something that's already computed internally, but not exposed in any interface, so I have to build it myself again. A surprisingly common case is a Python or Ruby library where they wrapped a C library to get good performance, and I need data in a C struct that they didn't think anyone would need.
Two is that CL, more than any other language, makes not just for concise code, but for concise diffs. (This is what you mention in your footnote, but I think it's true in general, not just with CLOS methods.) Whenever I wanted to make a change which I could describe briefly in English, it always ended up being something which I could implement in a similarly brief changeset.
Other HLLs can usually, IME, be just as concise for a given solution, but the nearby solutions in the problem space might require a completely different design. This is where the full power of CL helped me. If you know exactly what you want from the start, then you can implement it easily enough in almost any language. If you change your mind halfway through, the weird features available in that "full power" (CLOS dispatch, macros, special vars, etc) makes it possible to avoid rearchitecting the whole thing. (Then you have the choice to gradually refactor to avoid the need for them, or just leave it.)
Despite all the new programming languages in the past ~30 years, I haven't seen any which made diff size a design priority. I think even Clojure isn't quite as good at this, though I'm still a newbie in that language.