Hacker News new | ask | show | jobs
by randombytes6869 2201 days ago
A lot of the newer stuff in JS is great. The baggage is what bothers me. For all the flak Java gets for having ancient stuff, the old stuff in JS is way worse.

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.