For the best experience on desktop, install the Chrome extension to track your reading on news.ycombinator.com
Hacker Newsnew | past | comments | ask | show | jobs | submit | history | more fmx's commentsregister

When I first heard of the is-odd and is-even NPM packages I was sure they were a joke, yet there we are: 200K weekly downloads! Publishing the packages may have been the effort of one spammer, but many developers obviously chose to use them - that's the part that boggles my mind.


Well, look at one of the dependents: https://www.npmjs.com/package/handlebars-helpers - certainly a more useful npm package, but by the same author. Seldom do people actually type `npm install is-even` - there's just a jungle of transitive dependencies that can be traced back to one of jonschlinkert's many packages, which then circles back to something inane as `is-even` or `ansi-red`.

I once ran a simple grep in some of my node projects - most of them had a jonschlinkert package in node_modules, certainly not through any (direct) choice of my own.


Check out this very useful utility: https://github.com/mitsuhiko/is-jonschlinkert :)


Possibly related: https://github.com/SukkaW/nolyfill vs. ljharb and nodejs 4


I recently came across this issue (https://github.com/import-js/eslint-plugin-import/issues/213... and https://github.com/import-js/eslint-plugin-import/issues/181...) and man that person has really found him self a hill.

What is a bit worrying though is that he is an active member and contributor to TC-39. Meaning that this kind of community hostility is very much alive among the people who rule JavaScript.


View their obstinance: https://github.com/nvm-sh/nvm/issues/794

8 years later and despite much support for the `.node-version` file.

Someone else started using the .node-version file years ago, and because all open source packages won't form a committee to standardize this file, nvm will not support it.

They have a lot of hills. JS Private Properties was another.


Very often when I’m digging around GitHub Issues because of some bug or quirk or insanity in the JS ecosystem (which is often) I see someone spout the worst possible take - often being kind of a jerk about it - and when I look to see who’s responsible, very very often, ljharb’s name pops up. Often.

Dogpiling on someone deep in an HN comments tree isn’t exactly the classiest thing but…never having interacted with him myself, I’ve been harbouring this low-grade antipathy towards him - nothing unhealthy, just a groan whenever I see his name on GH - for years now, and it’s cathartic and almost gratifying, given his prominence in the community, to feel seen like this. Thank you.


I was doing some snooping around and found this earlier discussion https://news.ycombinator.com/item?id=37602923 from September 2023 (234 points, 110 comments), which I had missed at the time, very related to this current subthread, and includes posts such as these (https://news.ycombinator.com/item?id=37604635).

I think we as a community really need to have a conversation about ljharb and his role in the future of our industry. If he was only a library maintainer, that would be one thing, we could just move on, find workarounds, alternatives, etc. But his involvement in TC-39 makes him one of our rulers in a non-democratic structure. That makes this different.


To be fair, the ESM switch has been botched beyond compare.

It’s like they didn’t want to become Python 2/3, and then did the absolute worst possible alternative.

It is beyond frustrating that it’s up to individual package authors whether or not their package supports ESM or CommonJS.

And yeah, it’s a pita when one of your downstream dependencies decides to go ESM only, and breaks your entire friggin chain of stuff that depends on it being CommonJS.


I agree. Mistakes were made and migration has been unnecessarily hard. This particular issue doesn’t even affect me. I simply turned off `no-unresolved`. TypeScript handles a lot better anyway (even with jsdoc type annotations).

But what is the issue here is the stubbornness of the maintainer and his unwillingness to accommodate a very sizable portion of his user base. The industry is moving on, and as a TC-39 member he should be aware of where the community is moving as well as show some empathy with his users.


I love the release notes:

> It exists.


Would it be considered bad practice or in poor taste to make pull requests in projects with the sole objective of implementing is-even natively?

Thinking of being the change I want to see in the world.


It’s probably contextual but I’d say it’s in poor taste to use them in the first place. Removing them is a net benefit imo.


I see, thanks. I guess that answers one question, but raises another: why have his packages depend on more of his packages? If his goal was to be included in as many node_modules directories as possible, and handlebars-helpers was already included what's the point of pulling in is-odd/is-even, too?


Might be this from his GitHub bio “Several years ago, just before my 40th birthday, I switched careers from sales, marketing and consulting to learn how to program” Good way to get more eyeballs…


Ah yes, that actually explains a lot! Thanks.


Makes is-odd/is-even popular; many downloads; raises their (and his) profile.


Here we are all talking about him now!


He could sell rights to the repos and disavow any knowledge of its maintenance while maintaining the link in his own repos. When those sold rights are used to commit some crime he has plausible deniability as anyone else but got a payday. If you try spinning off the subpackage just prior to a sale then it shows some sort of intent.


Is there any evidence that he has ever done anything like this, or that he plans to? Or is this just pure speculation?


I didn't declare he's done this only that it is a vulnerability of depending on those packages.


I did learn one new thing from browsing the is-odd source code: Number.isSafeInteger(n) checks that n falls within the [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER] interval.

  ...
  if (!Number.isSafeInteger(n)) {
    throw new Error('value exceeds maximum safe integer');
  }
  ...


Shouldn't this simply return true instead of throwing?


Often the is-even package will be imported by another (less ridiculous) package of the same author.


the bigger joke is that programming language have no built in


Huh? Did you miss the modulo operator?


It is not just modulo, it also test for whether the input is a number or integer. It also has one dependency, is-number. And isOdd(“3”) returns true.

Basically it helps dealing with all the typing problems of Javascript, and also fitting into functional programming paradigms.


If you need to know if a number is even or odd then you should convert it to an int natively anyway.


Given the lack of integers and my hesitancy to trust modulo for non-integer variables, I don't know if I would trust it. You would need to add some safety checks, but either you create an is_even/is_odd function that has safety checks, or you have to rely on developers adding in the checks anytime the number might have been in close proximity to a floating point number.

Something as simple as this can end up being neither even or odd.

    (0.1 + 0.2) * 10


It wouldn't have 200k downloads a week unless there was a large number of programmers who didn't know how to do it.

I mean we're talking FizzBuzz secret sauce here. This must be total black magic for a catastrophic percentage of programmers


I have not read the source but I had always assumed that this was the lovingly crafted effort of someone who is intimately familiar with the js standard making sure that some hypothetical expression like ![1] is neither odd nor even. Surely the idea that modulo is beyond developers is too horrifying to contemplate.


Here you go:

    /*!
     * is-odd <https://github.com/jonschlinkert/is-odd>
     *
     * Copyright (c) 2015-2017, Jon Schlinkert.
     * Released under the MIT License.
     */
    
    'use strict';
    
    const isNumber = require('is-number');
    
    module.exports = function isOdd(value) {
      const n = Math.abs(value);
      if (!isNumber(n)) {
        throw new TypeError('expected a number');
      }
      if (!Number.isInteger(n)) {
        throw new Error('expected an integer');
      }
      if (!Number.isSafeInteger(n)) {
        throw new Error('value exceeds maximum safe integer');
      }
      return (n % 2) === 1;
    };
It does some checking the `value` is an integer in the safe range, which doesn't even seem right to me. Why shouldn't you be able to call this on integers outside the save range?


(10e15 + 1) % 2 === 0


All non-safe integers are even, yes?


Sad but true. For JavaScript these kind of functions can actually be useful because of all the quirks. If that was the GPs hint then I can understand.


A more catastrophic number of programmers a) dont know how dependencies work and b) think everyone else are idiots.


Perhaps, I solidly understand how dependencies work and in this case my observation is defensible

Someone made the decision to use that and someone thought using stuff made by a person's who makes those kinds of decisions was a good idea and so on.

You can git blame dependencies all the way down and research the parties involved. I've done it, built tools for it even.

A stack of people who make bad decisions doesn't make good software.


More likely the author made another, more useful, package that uses it.


Discussion from 5 years ago: https://news.ycombinator.com/item?id=16437973

Nice to see that some of the suggestions from there, like listing the hidden URLS (/leaders, etc.) seem to have been implemented.


Let's document it shall we:

A List of Hacker News's Undocumented Features and Behaviors - https://news.ycombinator.com/item?id=33076053 - Oct 2022 (68 comments)

A List of Hacker News's Undocumented Features and Behaviors - https://news.ycombinator.com/item?id=30459276 - Feb 2022 (64 comments)

A List of Hacker News's Undocumented Features and Behaviors (2018-20) - https://news.ycombinator.com/item?id=26866482 - April 2021 (255 comments)

A List of Hacker News's Undocumented Features and Behaviors (2018) - https://news.ycombinator.com/item?id=23439437 - June 2020 (266 comments)

A List of Hacker News's Undocumented Features and Behaviors - https://news.ycombinator.com/item?id=20292361 - June 2019 (25 comments)

A List of Hacker News's Undocumented Features and Behaviors - https://news.ycombinator.com/item?id=19212822 - Feb 2019 (183 comments)

Hacker News's Undocumented Features and Behaviors - https://news.ycombinator.com/item?id=16437973 - Feb 2018 (391 comments)


Just want to say I really like the values on your careers page. Compassion and humility, but raising the bar at the same time. (Of course, it could all be complete corporate BS, for all I know, but I'd really like to believe it's not!) It's such a shame you switched from "remote (worldwide)" to "remote (North America)"!


Yeah, as hilarious as this is when it happens to a bad guy the really sad aspect of it, for me, is that their customer service experience is not so abnormal. If it were, most would immediately identify it as fake. Like, counting the numbers of nuts in a photo is a bit much, but we are so used to horrible CAPTHAs now that it's just plausible. Same with the phone menu, etc.


Here is another good one: too easy to hit CTRL+Q instead of CTRL+W https://bugzilla.mozilla.org/show_bug.cgi?id=52821

Only 20-and-a-half years to fix that one! In this case it wasn't because nobody got around to it, but because people could not agree on the fix, even though more or less everyone agreed that the old behavior was bad.


There is a browser.warnOnQuitShortcut setting in about:config, that can have it pop up a nice warning and stop you accidentally ctrl+q'ing firefox. I don't know if they've gotten around to making that the default for new profiles. That bug thread is a irritating mess of conversations.


The timeline of this vulnerability might just be the best argument I've ever seen for full disclosure:

  2019-09-26 Reported to vendor with POC
  2020-01-14 Followed up with vendor
  2022-01-24 Publicly disclosed (still no fix over 2 years later!)
  2022-01-28 Fix released by vendor
I wonder if the same will happen with this RIGOL oscilloscope vulnerability.


No, the whole point of the original post is that a lot of users see (and use) the option, so that the app's database of personal data is full of rubbish.

I don't think the GP's scenario is realistic. A user would see that their location on the map is wrong before they even get a chance to begin navigation.

Besides, Google Maps already sometimes tells people to drive through roadblocks and locked gates and such (which it isn't aware of), so it already requires the driver to think for themselves to some extent.


XPrivacy was great, but apps would regularly crash when I denied some permissions - so apparently it was not faking data well enough. It got so bad that I would never just click "deny", but always "temporarily deny" first. Then, if the app worked, I would deny permanently. If it crashed I'd have to figure out the minimum set of permissions I could get away with granting.


I was with you until you mentioned "GDPR" right after "effective enforcement". GDPR is, if anything, a great example of ineffective enforcement.


https://thanks.dev/faq says:

  What are your fees?
  Tips at time of donation. You decide.
If payment is required to use a service then that payment is not a "tip" - it is a "fee". Anything over the required payment would be a "tip". This FAQ answer implies that the required payment is zero, which, it turns out, is false.

There is absolutely nothing wrong with charging a fee for a service, but there is something wrong with lying about it.


> There is absolutely nothing wrong with charging a fee for a service

Agreed, but percentage-based fees can quickly become an unfairly large part of payments. I love the idea of this project, but I'd prefer there to be a 5% or X dollars minimum, so that if 5% is more than X dollars, then it doesn't force 5% minimum. If I'm donating $500 to 45 projects, then each project on an even split is getting $11, but thanks.dev is getting $25 even though their service isn't actually in use by my app/service. Seems unfair to me.


My guess is that more than half of that $25 goes to the payment provider (Stripe etc.). Maybe more.

The remaining ~$10 will go to thaks.dev to cover operational costs, administration and other expenses.

I don't expect them to work for free. If you think it's unfair, contact the developers directly to see if you can wire them money (to avoid PayPal fees). If it's too much work, you can pay services like thanks.dev that does the work for you.


Then they should call it what it is: A fee (to cover operational expenses). It's still not honest to call it a tip.

(And now I'm realizing that American tipping culture may be playing in to differing expectations here...)

EDIT: I see they have now updated their wording.


> half of that $25 goes to the payment provider (Stripe etc.)

Surely they are not making a transaction for every patron/maintainer combination, but rather batching the payments.

Otherwise yes this is a Stripe charity :)


Why on earth would you think that a payment provider is taking 50%? They take ~3% + 30 cents

It's literally public information


Please take more time to read the context. If you read the post that I replied to instead of jumping to conclusions, you will find that you are incorrect

$25 refers to the 5% fee of the total amount ($500) that the site takes. I said that more than half of that fee is used to pay Stripe.


You're right @fmx. Have now updated the FAQ per helpfulclippy's suggestion. Thanks for pointing this out!


How do you suggest we can better word/explain it?


"We charge a 5% minimum fee on each payment. If you like what we do, you have the option of leaving a tip."


Actioned. Thank you helpfulclippy! :)


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search:

HN For You