5 ms·
OK, I must be missing something here... I get that reading in an log or config file as an S-expression is kind of cool, in a "one ring to rule them all" sort o
by AnimalMuppet 13y ago
OK, I must be missing something here...
I get that reading in an log or config file as an S-expression is kind of cool, in a "one ring to rule them all" sort of way, but... what's different between that and reading it in as a DOM or SAX tree?
Is the claim that Lisp's reader is somehow better than DOM or SAX? Easier to use? The resulting trees are easier to walk? Easier to use? What's the actual improvement from doing it the Lisp way?
It seems to me likely that Lisp can import a file into a tree easier (on the coder) than SAX can, but not significantly so. It's not one line versus dozens; more like one line versus a more complex line or maybe two lines.
- nnq 13y agoIn a world where XML with DOM and SAX exist, there is no difference. Now imagine that all this and all related technologies (and there are quite a few...) wouldn't even have had to be invented :) ...because you could have just used one parser, that you developed for the language in the first place. Think of the amount of code duplication in all the parsers for all the languages and file formats! I argue that the point should always be to reduce complexity of the systems and keep them DRY, even at the cost of slightly less functionality and slightly worse performance. Mainly because the introduction of complexity in a system tends to be irreversible in practice (whereas performance can always be better tuned and more functions can be added when/if needed). Now, in the real world, where the complexity of XML and friends (and this is probably not even the best example) has already been introduced, and where you can't make it disappear because you have so many things that depend on it now, you're right, there is no real benefit of the fact that you can also do it in a simpler way. And most pro-Lisp arguments hit the same walls: yes, you have a more elegant way to do things, but the complexity of the other ways of doing the same thing has already been introduced and it's not going away, so there's usually little benefit for also having simpler ways to do things.