4 ms·
I see a lot of criticism to one-line packages, but IMO in the end what matters is the abstraction. Thinking of the package as a black box, if the implementatio
by aylmao 7y ago
I see a lot of criticism to one-line packages, but IMO in the end what matters is the abstraction.
Thinking of the package as a black box, if the implementation for left-pad or is-promise was 200 lines would it suddenly be ok for so many other packages to depend on it? Why? The size of the package doesn't make it less bug-prone.
I see plenty of people who are over-eager to always be up-to-date, when there really isn't any point to it if your system works well, and so they don't pin their versions. This will break big applications when one-line packages break, but also when when 5000-line packages break. Dependencies are part of your source, don't change it for the sake of changing it, and don't change it without reviewing it.
- fludlight 7y agoIt would be more ok if left-pad was part of a package called, say, text-utils which also included right-pad, etc. Same with is-promise, it sounds like it should be a function in a package called type-checker.
- jackewiehose 7y ago> The size of the package doesn't make it less bug-prone. Of course it does. It's more bug-prone just by being a package. More code is more bugs and more build-system annoyance is more terror (=> more bugs). If I only need one line of functionality I will just copy and paste that line into my project instead of dealing with npm or github. > Dependencies are part of your source I agree. If you see news about broken packages like this and you don't just shrug your shoulders your build-system might be shit.