/r/programming
Computer Programming
/r/programming is a reddit for discussion and news about computer programming
Guidelines
Info
Related reddits
/r/programming
A debate occurred between the author of the is-number package (and is-odd, is-even, and 1500more) and a PR author over micro-libraries. https://github.com/micromatch/to-regex-range/pull/17
The PR proposed replacing the 'is-number' package with its inline code. While the code is <1KB, the full package with README/license is ~10KB. With 70M weekly downloads, this simple change saves 440GB of npm bandwidth weekly.
The author of 'is-number' called the PR "useless" - despite it being his own code just moved inline. Some of his other packages include 'is-odd' which depends on 'is-even' which depends on... you guessed it, 'is-number'.
The debate: Pro micro-packages: Well-tested, auto-updates, saves dev time Against: Security risks, fragile dependencies (remember left-pad?), unnecessary bloat
TL;DR: JavaScript's micro-package ecosystem might be getting out of hand. Sometimes the simplest solution is just writing the code yourself. Or standards library when?