3 ms·
> If you don’t see the clean syntax and simple utility in that then fair enough, but I do. I see a "cleaner syntax in the example" but the fragments of code yo
by jlg23 8y ago
> If you don’t see the clean syntax and simple utility in that then fair enough, but I do.
I see a "cleaner syntax in the example" but the fragments of code you don't like, the literals, are something that you won't see in production code except for a few constants maybe. The difference in ~"characters to change" for switching from list to vector is far smaller than the amount of characters spent on this thread... (edit: even over the lifetime of a programmer)
- justinhj 8y agoIt's not really about just saving characters, it's about the fact that vector, set and to some extent map can be used in Clojure code as if they are an equal citizen in the syntax to list. It saves valuable mental cycles that can be used on your actual problem instead.