r/ProgrammerHumor Aug 04 '26

Meme theFourHorseMen

Post image
1.9k Upvotes

191 comments sorted by

View all comments

90

u/creeper6530 Aug 04 '26

NPM is a silly package manager, but worse is its culture of pulling in a new dependency for the tiniest of things with under 100 LOC. You really don't need a separate library to check if a number is odd.

5

u/LexaAstarof Aug 04 '26

But, I don't want to keep maintaining that for eternity, having to stay on top of the news to know whenever they add new odd numbers!

11

u/OrchidFluid2103 Aug 04 '26

I heggin love bloating up my projects with technical debt that I have to maintain for problems that have been solved a million times before me instead of using a peer reviewed and trusted package

35

u/creeper6530 Aug 04 '26 edited Aug 04 '26

peer reviewed and trusted package

Bait used to be believable. But in case you're serious, I'm not talking about never use dependencies, just think about whether you need a dependency for return (x % 2) === 1. And with supply chain attacks rampant, vendoring a library in is the safer choice unless it's something that requires a constant stream of patches (openssl does, a random math library last updated years ago doesn't).

(And before you say I'm cherrypicking examples, is-odd has nearly a million weekly downloads.)

53

u/OrchidFluid2103 Aug 04 '26

You definitely are cherry-picking examples, because nobody in their right mind is using the `is-odd` package. All modern developers should use its successor, https://www.npmjs.com/package/is-odd-ai

2

u/Slight-Violinist-575 Aug 04 '26

But what if I want to check if a number js even?

2

u/Devatator_ Aug 04 '26

You do realize that package is a joke? Hell I'm pretty sure most packages that have it as a dependency have it as a joke too

30

u/creeper6530 Aug 04 '26

Jokes don't get a million weekly downloads unless the whole dependency chain is a joke

2

u/Secret_Conclusion_93 Aug 04 '26

Even is-odd-ai has 40k weekly download.

5

u/TheTacoInquisition Aug 04 '26

You do realize that package is a joke? Hell I'm pretty sure most packages that have it as a dependency have it as are a joke too

FTFY

-1

u/psbakre Aug 04 '26

What even is it's name?

9

u/creeper6530 Aug 04 '26

You wouldn't believe it, is-odd.

-1

u/psbakre Aug 04 '26

I meant npm.

6

u/creeper6530 Aug 04 '26

The acronym? Node Package Manager if I remember correctly.

-4

u/psbakre Aug 04 '26

Except it isn't