top | item 34150536

(no title)

pitsnatch | 3 years ago

Why is this the case?

discuss

order

raverbashing|3 years ago

Because JS had a very poor stdlib and attracted people that had little to no experience in best-practices in older languages

Hence left-pad. And this pet-peeve of mine https://nodejs.org/docs/latest/api/process.html#processargv (who cares about the node fullpath in argv[0]?)

SpeedilyDamage|3 years ago

Why oh why do people cite left-pad like this as an example of package bloat? It’s functionality was so valuable it was included in ECMAScript 2017!

The problem with left pad was a security one, not a package bloat one.

dtgriscom|3 years ago

Here's my theory. Older programming languages force you to think about sub-dependencies: if you decided to use a third-party library, you would have to look at and manually add its requirements to your build system.

But, with npm, suddenly it was trivial to include other packages without having to worry about sub-dependencies. The whole tree just magically added itself to your build, and only if you paid attention to the build process would you discover just how many developers you were transitively trusting.

marcosdumay|3 years ago

Well, while yes, automatic dependency management is a really relevant reason why things got that bad, it can't be the only reason.

Programs in other languages with the same kind of tooling tend to stop at hundreds or at most low-thousands of dependencies. Javascript code often reach tens or low-hundreds of thousands of dependencies.

Dependency explosion is bad all around, but JS is exceptionally bad.

scotteric|3 years ago

Javascript lacks many basic facilities that other languages have.