3 ms·
>In JS you need a handful of third party packages just to tell if a number is odd. You really don't, but for some reason JS developers have decided that this i
by Hamuko 5y ago
>In JS you need a handful of third party packages just to tell if a number is odd.
You really don't, but for some reason JS developers have decided that this is the optimal way to check if a number is odd.
- bavell 5y ago> You really don't, but for some reason JS interns have decided that this is the optimal way to check if a number is odd. FTFY :)
- Hamuko 5y agois-odd gets about two million downloads a month. is-number gets 278 million downloads a month. I guess the interns have been very busy.
- pfraze 5y agoThose numbers are a little deceiving. It’s likely that those modules are upstream of a popular module or two. It’s not like they are installed by projects directly.
- hombre_fatal 5y agoIt's only directly depended on by 40 or so npm modules, and most of them look like beginner/joke modules like "is-ten-thousand" where they brag about being featured in a "worst npm libraries" article. Quickly in these sorts of conversations, we're really just making fun of beginners for using dumb packages. With the popularity of Node, it makes sense to me that you can have beginners searching npm/google for how to tell if a number is odd, and for whatever reason they find is-odd or whatever. And perhaps the idea of even collecting packages to do simple things is something fun for them. I remember having a weird maximalist attitude when I was a beginner using Rails. I'd install a Ruby gem and I could use it anywhere in my files without even importing it, usually a single line of abstraction. For some reason that appealed to me even though I could have done it myself. I think I had this idea that people writing libraries were doing things right, and I was right for tapping into them. I think we should save our denigration for the serious, popular projects that use packages rather than the fact that beginners use them. Like, this sort of package has no business being a transitive dep of Express (it isn't) and popular Express middleware, and mainly because x-deps are security issues.
- pfraze 5y agoVery good points, and I think you're right on the numbers here! I went dependent spelunking - almost half of it is because is-even is a dependent (naturally) but then I didn't notice any dependents of is-even to explain it. I guess people do just google it and grab the module. Mea culpa for the unsubstantiated assertion before.
- lucideer 5y agohandlebars-helpers is one of the big dependents afaik.
- bryanrasmussen 5y agois-odd package.json contains "dependencies": { "is-number": "^6.0.0" },
- marcosdumay 5y agoIf I remember correctly, that library was a joke. That people immediately started exhorting as "the right way to do it" as a joke. That due to Poe's law other people immediately understood as the right way to do it...
- zkldi 5y agoThis is absolutely not true, and I'm tired of seeing this. is-odd, alongside a bunch of other microdependencies are almost all the work of one person, who made as many micropackages as possible and then PRd them into other more popular libraries. There are not 6 million people directly downloading `is-odd` a day. At all. When this person could make one library to do something (like an ANSI-Colouring package), they would fractalise it into as many dependencies as possible, because that boosts their download count on NPM. I should note that this is just one person who has managed to nestle their way into some larger projects. I apologise for the spam, but this point really needs hammering home: https://github.com/jonschlinkert/ansi-black https://github.com/jonschlinkert/ansi-black https://github.com/jonschlinkert/ansi-reset https://github.com/jonschlinkert/ansi-reset https://github.com/jonschlinkert/ansi-bold https://github.com/jonschlinkert/ansi-bold https://github.com/jonschlinkert/ansi-dim https://github.com/jonschlinkert/ansi-dim https://github.com/jonschlinkert/ansi-italic https://github.com/jonschlinkert/ansi-italic https://github.com/jonschlinkert/ansi-underline https://github.com/jonschlinkert/ansi-underline https://github.com/jonschlinkert/ansi-inverse https://github.com/jonschlinkert/ansi-inverse https://github.com/jonschlinkert/ansi-hidden https://github.com/jonschlinkert/ansi-hidden https://github.com/jonschlinkert/ansi-strikethrough https://github.com/jonschlinkert/ansi-strikethrough https://github.com/jonschlinkert/ansi-black https://github.com/jonschlinkert/ansi-black https://github.com/jonschlinkert/ansi-red https://github.com/jonschlinkert/ansi-red https://github.com/jonschlinkert/ansi-green https://github.com/jonschlinkert/ansi-green https://github.com/jonschlinkert/ansi-yellow https://github.com/jonschlinkert/ansi-yellow https://github.com/jonschlinkert/ansi-blue https://github.com/jonschlinkert/ansi-blue https://github.com/jonschlinkert/ansi-magenta https://github.com/jonschlinkert/ansi-magenta https://github.com/jonschlinkert/ansi-cyan https://github.com/jonschlinkert/ansi-cyan https://github.com/jonschlinkert/ansi-white https://github.com/jonschlinkert/ansi-white https://github.com/jonschlinkert/ansi-gray https://github.com/jonschlinkert/ansi-gray https://github.com/jonschlinkert/ansi-grey https://github.com/jonschlinkert/ansi-grey https://github.com/jonschlinkert/ansi-bgblack https://github.com/jonschlinkert/ansi-bgblack https://github.com/jonschlinkert/ansi-bgred https://github.com/jonschlinkert/ansi-bgred https://github.com/jonschlinkert/ansi-bggreen https://github.com/jonschlinkert/ansi-bggreen https://github.com/jonschlinkert/ansi-bgyellow https://github.com/jonschlinkert/ansi-bgyellow https://github.com/jonschlinkert/ansi-bgblue https://github.com/jonschlinkert/ansi-bgblue https://github.com/jonschlinkert/ansi-bgmagenta https://github.com/jonschlinkert/ansi-bgmagenta https://github.com/jonschlinkert/ansi-bgcyan https://github.com/jonschlinkert/ansi-bgcyan https://github.com/jonschlinkert/ansi-bgwhite https://github.com/jonschlinkert/ansi-bgwhite
- kybernetikos 5y agoCan you cite anyone who actually thinks this? People complain about these tiny packages they find on npm the whole time, but usually these packages come from people learning how to create their first npm packages, or creating or following tutorials. They aren't serious packages used by typical developers for production apps. If you go to the isEven github repository you can even see "I created this in 2014, when I was learning how to program." If you hover over his 'organisation' you'll see the text "This is a joke. You'll only see this org if you are attempting to troll me about repositories I created when I was learning to program."
- dahfizz 5y agois-odd gets between 400k and 500k downloads every week[1]. The package was written as an exercise in learning how to create a small, useless package. But a huge portion of the JS development community choosed to import and use the package anyway. [1] https://www.npmjs.com/package/is-odd https://www.npmjs.com/package/is-odd
- kybernetikos 5y agoHave a look at where those downloads are coming from and which packages are actually using it: https://www.npmjs.com/browse/depended/is-even https://www.npmjs.com/browse/depended/is-even They're jokes or satire or learning repositories, like `install-is`: "Installing this package installs a bunch of useless packages" or Stalinsort or module-practice-january. The most serious looking dependents are by the same author.
- imtringued 5y agoYou aren't looking hard enough. The joke libraries don't get any downloads. install-is gets 1 weekly download. https://news.ycombinator.com/item?id=30991487 https://news.ycombinator.com/item?id=30991487
- kybernetikos 5y agohandlebars-helpers falls under my last sentence. The linked thread is literally with the guy who wrote is-odd.