Hacker News new | ask | show | jobs
by sime2009 1748 days ago
> JavaScript has more of a culture of many many small hyper focused packages.

> This has two benefits. One - you have less dead code in your final build. Two - if one of your dependencies is already using leftpad you essentially get to use it "for free".

This culture has really backfired in practice.

What we now have is a proliferation of packages which do the same thing. The problem is that it is less likely that your dependencies are going to be using the packages, even though desired functionality is the same. For example, if you have two dependencies which need to do HTML encoding, chances are that they choose different packages for that job. So now as an app developer you have to pay for both.

This combined with a culture which loves Semver but doesn't mind breaking backwards compatibility ("just update the major version!") gives a huge mix of packages which can't be fixed by tree shaking.