Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Ignoring tree shaking for a second.

If I have a library that needs to handle a bunch of general cases, but I only need 1 or 2 of them - it's probably less code to just write out those cases myself.

As a trite example, look at the source code for `is-even`. It imports the is-odd package, and the is-odd package has a bunch of error checking (and imports a library "is-number" to check errors too!) before it returns `n % 2 === 1` to is-even just to be negated.

Now blow this insanity up to all your packages of various sizes and you have a tonne of useless code that nobody needs.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: