News for hackers. Stuff that matters.
Re:Lessons on Writing JavaScript and React from ClojureScript by globular-toast on Sunday May 09, 2021 @06:46AM (#27094911)
I agree with this. Many JS programmers have come into it either as their first language, or from object-oriented languages like Java. Unlike Python, there is no One True way to do things in JS. If you look at JS in the wild you'll see the same thing done in a myriad of different ways. I often think JS programmers prefer the one that makes them look the most clever. Learning a language like Clojure teaches you the importance of mutability, functional style etc. Once you know those things deeply, it's not about aesthetics or looking clever any more, it's about writing good code.

But there is also the practical aspect. Plain JS lacks a lot of standard library support to be functional. You have to be really careful about what is functional and what isn't. The standard library is also inconsistent, like PHP (for example, how Map and Set .add returns the object but .delete returns a Boolean).

There are no comments on this comment yet.