• Randelung@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    10 个月前

    Seems to me the only reason for these kind of dependencies to exist in the first place is that people really, really, really, REALLY can’t code.

    • Bourff@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      10 个月前

      Well javascript is the default language of the web, so no surprise it attracts a lot of newbies.

    • lily33@lemm.ee
      link
      fedilink
      arrow-up
      1
      ·
      10 个月前

      And who hasn’t contributed any code to this particular repo (according to github insights).

      • GBU_28@lemm.ee
        link
        fedilink
        English
        arrow-up
        2
        ·
        10 个月前

        Not familiar with this exact team, but a skilled reviewer/issue triager is useful. We can hope this person at least tested the changes.

  • ChaoticNeutralCzech@feddit.org
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    10 个月前

    If you think is-number can be replaced with a one-liner, you don’t have the enterprise code mindset. What if the world gets more inclusive and MMXXIV, ½ and ⠼⠁ become recognized as numbers? 𒐍𓆾 were numbers in the past but what if people start assigning numeric value to other characters? Are 🖐🔟💯🆢🂵🀌🁅 numbers of the future???
    /s

    I’m not even all kidding, Regex implementations are split on whether “٣” matches \d.

      • ChaoticNeutralCzech@feddit.org
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        10 个月前

        You may argue that writiing 2024 as “MMXXIV” and not “ⅯⅯⅩⅩⅣ” is a mistake but while typists who’d use “2OlO” for “2010” (because they grew up using cost-reduced typewriters) are dying out, you’ll never get everyone to use the appropriate Unicode for Roman numerals.

    • elxeno@lemm.ee
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      10 个月前

      Look at what you’re missing!

      Edit: also, is-odd depends on is-number

      • JackbyDev@programming.dev
        link
        fedilink
        English
        arrow-up
        1
        ·
        10 个月前

        Heaven forbid they make a package is-even-or-odd with both. Wait. Don’t give them ideas. They’ll just make it depend on both.

  • josefo@leminal.space
    link
    fedilink
    arrow-up
    1
    ·
    10 个月前

    I really need a community here solely dedicated to GitHub drama. This is so much better than Twitter drama, more relatable.

  • floofloof@lemmy.ca
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    10 个月前

    It looks like “is-number” was never more than a few simple lines of code. It still has 68 million downloads per week.

    https://www.npmjs.com/package/is-number

    I checked one of our main projects at work, and it’s in there as a dependency 6 levels deep via the “sass” package.

    • sushibowl@feddit.nl
      link
      fedilink
      arrow-up
      1
      ·
      10 个月前

      is-number is a project by John Schlinkert. John has a background in sales and marketing before he became an open source programmer and started creating these types of single function packages. So far he has about 1400 projects. Not all of them are this small, though many are.

      He builds a lot of very basic functionality packages. Get the first n values from an array. Sort an array. Set a non-enumerable property on an object. Split a string. Get the length of the longest item in an array. Check if a path ends with some string. It goes on and on.

      If you browse through it’s not uncommon to find packages that do nothing but call another package of his. For example, is-valid-path provides a function to check if a windows path contains any invalid characters. The only thing it does is import and call another package, is-invalid-path, and inverses its output.

      He has a package called alphabet that only exports an array with all the letters of the alphabet. There’s a package that provides a list of phrases that could mean “yes.” He has a package (ansi-wrap) to wrap text in ANSI color escape codes, then he has separate packages to wrap text in every color name (ansi-red, ansi-cyan, etc).

      To me, 1400 projects is just an insane number, and it’s only possible because they are all so trivial. To me, it very much looks like the work of someone who cares a lot about pumping up his numbers and looking impressive. However the JavaScript world also extolled the virtues of these types of micro packages at some point so what do I know.

      • NotNotMike@programming.dev
        link
        fedilink
        arrow-up
        2
        ·
        10 个月前

        Wow you’re right, he’s the author of the infamous “is-odd” and “is-even” packages. What an odd person.

        Someone in the OP PR mentioned the amount of energy used to download these tiny packages and its actually something crazy to think about

        • floofloof@lemmy.ca
          link
          fedilink
          English
          arrow-up
          1
          ·
          10 个月前

          It makes you wonder why anyone uses them though, since so many of them do things that are trivial in modern JavaScript.

          • nickwitha_k (he/him)@lemmy.sdf.org
            link
            fedilink
            arrow-up
            1
            ·
            10 个月前

            And anyone who has been around for a while should remember when left-pad broke node.js. Including unnecessary dependencies, instead of writing trivial code is just bad practice.