DEV Community

Discussion on: NPM hot-takes and the pitfalls of trivialization

Collapse
 
alainvanhout profile image
Alain Van Hout

Definitely not to start a (reverse) war of the languages, but the java standard library is wholy inadequate. Together with tree shaking on the one hand, and the fact that a typical webapp pipes a lot of javascript on the other, there is no technical or practical impediment to having bigger libraries.

Thread Thread
 
dubyabrian profile image
W. Brian Gourlie • Edited

I actually feel like Java's standard library has improved considerably, especially with Java 8.

Tree shaking would solve the issue of depending on a handful of functions from a large library, but tree shaking also requires some effort to set up and can be imprecise due to the highly dynamic nature of javascript.

The biggest challenge at this point would be adoption. In practice, with so many packages depending transitively on things like left-pad and is-odd, introducing a consolidated package would likely just fragment things and make it worse.

Assuming that the issue of breaking thousands of packages à la left-pad is solved, I don't find micro-libraries to be particularly distasteful.