DEV Community

Discussion on: 10 useless NPM Package with millions of downloads

Collapse
 
fijiwebdesign profile image
Gabirieli Lalasava

There is some use to all of these packages including is-even. That's for it's semantic value. They are trivial but not useless.

The first time you wrote is-even you had to search for it on Google, or yahoo/MSN search if you've been around that long. That's a tedious process with a lot of cognitive overhead. Understanding the modulo operator or using bitwise functions to do it.

Now an npm library proves it's weight by usage and popularity. It's has a lot more context than a search. So you can be sure it works just by the popular consensus and dependencies that hopefully work. This lessens the cognitive overload. It's basically a living code documentation with real world tests.

This can be shown by the new AI advancements like openai codex. From many useless/trivial pieces of code it can create context to create more code. Without the useless bits there isn't enough context for the larger bits.

If you come across modulo operator in a book or search, it takes a lot to grok it.

If you come across i%2 === 1 in arbitrary code you need a lot more context to understand what it does.

But if you see is_even() that gives more context.

Come across require('is-even') and that's getting very firm if you see that a couple thousand times. Multiply that by the contexts of code using it as a dependency and you get a pretty clear picture.

It's not just for AI. As a developer you make the same assumptions when you read code. And you learn faster from code with context.

Some of th best examples are now pretty redundant like many of the underscore, jquery etc. functions. They have made their way into the core language.