5 ms·
>Were they using ESNext features? Where they using Babel to compile to ES3 or ES5? Or were they just using the old-fashioned JS that's filled with tons of huge
by yogthos 9y ago
>Were they using ESNext features? Where they using Babel to compile to ES3 or ES5? Or were they just using the old-fashioned JS that's filled with tons of huge warts?
Each extension of Js adds complexity to the overall language with its own quirks and warts. Different libraries will be written in different styles and using different features, and you have to juggle all of that in your head to work with the language effectively. I think we have plenty of evidence nowadays that working with large languages introduces a significant mental overhead.
I don't see why I'd want to work with a large quirky language when I have a simple and focused one available to me. With all the new features that ES6/7 add, Clojure still ends up being more concise vast majority of the time.
>There are several built-in methods in modern JS for returning new objects based on existing arrays and objects such as map, filter, and reduce, and there are libraries to polyfill basically the rest of `clojure.core` into it such as lo-dash.
Or I can just use a language that was designed around immutability and avoid all that. What is the advantage here?
>ClojureScript macros may come in handy with this, but that still has its own caveats to be avoided. In my experience, it's not much different than the overhead you get from using JSX itself or a similar compiles-to-JS template language.
You don't need any macros for this. ClojureScript syntax maps really well to HTML because it's s-expressions. Reading hiccup syntax is actually easier than reading plain HTML in my experience. Also, since it's just regular data, it's trivial to manipulate it in the language. There are no new rules to learn, no DSLs to memorize, it's just plain data.