DEV Community

Discussion on: 10 useless NPM Package with millions of downloads

Collapse
 
jozsefsallai profile image
József Sallai

While there are some packages here that could be considered useless, I can see a potential use case for them, and most of the time it boils down to functional programming approaches and code readability.

For example:

arr.filter(isOdd)
// instead of
arr.filter(n => n % 2 === 1)

// or

arr.map(upperCase)
// instead of
arr.map(s => s.toUpperCase())
Enter fullscreen mode Exit fullscreen mode

Is it worth installing additional packages only to make the code slightly shorter and more readable? That depends on who you are and what your use case is. Some people will like that idea, others will be left with a sour taste in their mouth. Personally, I'm indifferent but I still wouldn't call the packages useless just because I can't find any use for them.

As others pointed out already, some of these packages are now used as polyfills for older browsers that don't have the said feature. You may not care about IE 11 but there are developers who do. Again, it's entirely subjective but IE 11 still has a userbase - even if it's not that big. There's still a lot of corporations who reinforce using IE for their management systems, for example.

store2 has way too many convenience features to be called "useless". Again, just because you don't find any use for it and you're a 10X developer with a great ego who knows how to reinvent the wheel and implement those features manually, doesn't mean that it's useless. You could think of this package as a superset of localStorage. Would you say TypeScript is useless because JS exists and you can just use JS instead of installing additional dependencies just for the sake of convenience?

ismobilejs is definitely not a useless package. I don't see the point of reinventing the wheel by copying and pasting weird regular expressions from the internet when you can just use what the community already has to offer. This is kinda the point of open source and package-based language ecosystems -- reusability. This package is something I've personally used and I genuinely don't see why you think it's useless.

So yeah, in conclusion: this article is heavily subjective and completely based on what your definition of "useful" is. It doesn't take into consideration any potential use case these packages may have and your only counter-argument is that you can implement them yourself easily - which in itself is not necessarily a good enough counter-argument. I'm surprised lodash or its split packages aren't listed.

Collapse
 
hyoretsu profile image
Aran Leite

Babel has polyfills, so you don't need to write old JS or use outdated packages to support old browsers.

Collapse
 
shadowtime2000 profile image
shadowtime2000 • Edited

Yes, Babel has polyfills, but not everyone wants to create complex build systems and may just want to stay a little more basic. Saying that a polyfill package is useless just because Babel can provide it is a poor argument. Packages aren't useless just because other tools can provide the same thing. It comes down to developer preference on whether they want to use Babel or whether they want to be simpler.

Collapse
 
seniya23 profile image
Seniya Rathnayake

Believe me or not, lodash was first to pop in my mind after reading the argument that we can implement these with minimal lines. XD

Collapse
 
jyotishman profile image
Jyotishman Saikia

lodash has a lot of features not just one thing to do. so believe it is not useless

Thread Thread
 
shadowtime2000 profile image
shadowtime2000

store2 adds a lot of features built upon standard browser JS features, just like lodash, except lodash is much easier to replicate than store2. By your logic isn't store2 not useless then, because it has a lot of features. Contradictory, don't ya say?

Collapse
 
jyotishman profile image
Jyotishman Saikia

thanks József Sallai ! for the feedback. I am neither a 10x developer nor an egoistic person. All these are personal views and my own experience. If I try to write all these disclaimers in my article nobody would be interested in reading . But at-least a section of developers would be there who would agree that all these features can be achieved with just some minimal effort.

Collapse
 
jozsefsallai profile image
József Sallai

Which is completely fine, you are entitled to your own opinion. I'm definitely not saying you're the only one who has this opinion - again, it comes down to your development practices and use case. If you prefer writing utility functions yourself and import those instead of installing additional packages, there's nothing wrong with that.

But I still think "useless" is a bit harsh, at least for some of these packages. I can totally see most people agreeing that is-odd and similar packages are useless - in fact I used to joke about it too. But I don't think store2 or polyfills should go under the same category.

I'm not saying you should add a disclaimer (albeit I don't think it would really hurt your article in any way), but it would be nice to include at least some potential use cases in it instead of just laughing at the people who use these packages. It will make your article less opinionated and more unbiased, while also not discrediting the authors of the packages and the people who use them.