| After using many languages for a long time, and working mostly with JavaScript/TypeScript in the last years, I agree with many things that you said. However, I think that is good to recognize the good things too: - JS function and object notation is very flexible and nice to work with. Each time that I go back to Java I feel the pain. - PHP makes JS look nice and consistent by comparison (note I used PHP from v3 to v5... so my comment maybe wrong today) - Adopting functional constructs for some parts of the std lib was good. Many times I wished to have an equivalent map/filter/reduce in Python (the list comprehension syntax is terrible) - NPM and small modules receives tons of criticism. But it allowed NodeJs to thrive. Anybody can publish or get a lib with one command. By comparison doing the same for Java was really hard in the past (you needed permission to publish to MavenCentral... and if you were lucky you were allowed after many days of mail exchanges). The situation in other languages is not better: Python package management is a mess of options, Swift package management is not mature enough. - JS doesn’t have threads... but some languages (eg Dart) moved away from the classic threads constructs to adopt actors. If you did anything with mid complexity using Java threads and dealing with synchronized/wait you start to appreciate the simplicity of async / await. - Template literals existed in many languages (shell scripting, Perl, etc). But in JS they can be easily extended with template functions. - I prefer any of the Node web server frameworks over the pain of Java (I worked for many years using servlets, JEE, Spring.. and Java Rest API frameworks). I’m not trying to do a “what aboutism” argument, just highlighting that besides the limitations there are also good design decisions in the JS ecosystem. |
Java cruft is better these days if you use 11+ with Lombok. Almost decent. You can also use Kotlin which is honestly good, but unless you pay up for IntelliJ support for it is mediocre at best. I really like Typescript's nominal typing, wish Java chose that road.
I'm not a Python guy, but Java has Streams and RxJava which is great for functional stuff. I'm pretty sure RxJS was originally a JS port of RxJava. The same library has flavors in most languages now, you may be interested in the Python version https://github.com/ReactiveX/RxPY
Publishing to NPM registry is much easier, but everything else is worse. I blame much of it on the lacking standard library. But JS not packaging libraries in archives, plus using minifaction instead of a bytecode format both suck. JS has a huge parsing problem, for some sites half the page load time is parsing JS. VM's with an efficient code representation like C# and Java avoid this. Java and C# package source, compiled code, and documentation in a standardized (and efficient) way. NPM just isn't there yet.
Java is missing async await, but there's also grumbles about supporting it and function coloring. Java has Akka, promises (CompletableFuture), parallel streaming, and traditional threads. The problem with supporting async/await without threads is that it doesn't solve for modern CPU's having more and more cores. In Java/C# its trivial to use the whole machine and share structures.
You should try Vert.X, its very similar to Express. I would almost dare say Express borrowed a lot from it.
There's some good design decisions rolling in, but still plenty of reasons I avoid it when I can.