• lily33@lemm.ee
      link
      fedilink
      arrow-up
      1
      ·
      4 months ago

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

      • GBU_28@lemm.ee
        link
        fedilink
        English
        arrow-up
        1
        ·
        4 months ago

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

    • elxeno@lemm.ee
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      4 months ago

      Look at what you’re missing!

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

      • JackbyDev@programming.dev
        link
        fedilink
        English
        arrow-up
        1
        ·
        4 months ago

        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.

      • boonhet@lemm.ee
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        4 months ago

        These are both made by the same person from this PR (who also made both the package the PR is on, and the is-number package that is being removed as a dep)

      • darklamer@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        4 months ago

        Sure, but when was the last time you saw, say, a Python project using some third-party library instead of simply calling isnumeric() from the standard library?

        There’s a reason for these jokes always being about Javascript.

          • boonhet@lemm.ee
            link
            fedilink
            arrow-up
            1
            ·
            4 months ago

            And let’s not talk about C++…

            Don’t worry, people make plenty of jokes about C++ too.

            Hell, people joke about my favourite language too - Cargo build times are a meme unto themselves.

            I don’t think there’s a truly great dependency management system there. Though all in all, I’ve generally had no MAJOR issues with Cargo, Maven or Gradle.

    • zqwzzle@lemmy.ca
      link
      fedilink
      English
      arrow-up
      1
      ·
      4 months ago

      I only glossed over it… but this looks like it’s trying to check dynamic typing issues? It’s like a statically typed language with extra steps?

      • AVincentInSpace@pawb.social
        link
        fedilink
        English
        arrow-up
        1
        ·
        4 months ago

        I don’t think typescript exists because JavaScript wasn’t designed to be statically typed. I think Typescript exists because JavaScript wasn’t really designed, period.

      • AVincentInSpace@pawb.social
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        4 months ago

        Must be pretty good, considering literally every time I check in on the JavaScript community it is somehow more on fire than it was last time. I guess I must have a front row seat to all their misfortune. Either that or they’re just incompetent, but it couldn’t be that, could it?

  • KillingTimeItself@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    1
    ·
    4 months ago

    i think programmers need a self inflicted rule of it being less than 500 lines of code means you need to write it instead of using a pre written package/library.

    On the other hand, we could make the packages like is-number the worst possible way of checking if something is a number, which would be really fucking funny…

  • ChaoticNeutralCzech@feddit.org
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    4 months ago

    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.

    • modeler@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      4 months ago

      All junior devs should read OCs comment and really think about this.

      The issue is whether is_number() is performing a semantic language matter or checking whether the text input can be converted by the program to a number type.

      The former case - the semantic language test - is useful for chat based interactions, analysis of text (and ancient text - I love the cuneiform btw) and similar. In this mode, some applications don’t even have to be able to convert the text into eg binary (a ‘gazillion’ of something is quantifying it, but vaguely)

      The latter case (validating input) is useful where the input is controlled and users are supposed to enter numbers using a limited part of a standard keyboard. Clay tablets and triangular sticks are strictly excluded from this interface.

      Another example might be is_address(). Which of these are addresses? ‘10 Downing Street, London’, ‘193.168.1.1’, ‘Gettysberg’, ‘Sir/Madam’.

      To me this highlights that code is a lot less reusable between different projects/apps than it at first appears.

      • ChaoticNeutralCzech@feddit.org
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        4 months ago

        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.

        • Contravariant@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          edit-2
          4 months ago

          Wouldn’t surprise me if even Unicode advices against using Roman numerals depending on meaning.

          It was mostly a joke (though frankly if you try any implementation more complicated than that joke you’re going to have a bad time).

        • oo1@lemmings.world
          link
          fedilink
          English
          arrow-up
          1
          ·
          4 months ago

          Even if they did use unicode, any codeset , glyph or language changes over time , ulimately they emerge out of communication, not the other way round.

          If some culture decides they want to use the glyph “2” to mean a word “to”, they can and will, and no codeset is going to stop them. And if they get their message to their intended audience it doesnt matter that somebody else’s isnumber fuction get’s it wrong.

          A person, community or standard codeset or dictionary cannot deny the accuracy or content of encrypted communication just because they can’t decipher it.

          Put another way a more robust isnumber() should maybe have a second argument to specify the codeset being used, and maybe whether written words - in some defined languare - are also to be converted

          On the other hand “1/4/12” is not a fucking date.

          • ChaoticNeutralCzech@feddit.org
            link
            fedilink
            English
            arrow-up
            1
            ·
            4 months ago

            “1/4/12”

            Excel is going to have a Date with you, and it’s not asking further questions. If you didn’t wish to consent to have your col’n shattered, you should have preceded it with a '.

            • oo1@lemmings.world
              link
              fedilink
              English
              arrow-up
              1
              ·
              4 months ago

              yeah, I’ve been rohypnolled by both microsoft and oracle, and general cloud shit , and various co workwers so many times now i barely even notice.

              Hilariosly excel has recently started asking now, I think it says something like: “I’ve just fucked up several columns in your csv that you went to the bother of enquoting.” “Do you want me to reload it and i’ll try to un-fuck a few of those columns? ( whispers to audience - but probably not all of them - tee hee).”

              I think my employer just needs to employ 25-50 more “delivery” managers and empower them to spend millions on a prettier barrel for us to bend over, that’ll solve it. Maybe it’ll have flufffy handcuffs.

  • TootSweet@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    4 months ago

    I’ve literally told my coworkers “I’m not saying we should never use dependencies. But every time you add a dependency, you should hate yourself a little bit more. Some self flagellation can’t hurt either.”

    • lad@programming.dev
      link
      fedilink
      English
      arrow-up
      2
      ·
      4 months ago

      So, every time I use a library to recognize patterns on a picture, to interact with Kafka, do some SSL, or do database mapping, I should hate myself, noted

      We did Elastic API integration in Java by creating and maintaining huge half-codegenerated transformer from code to Elasticsearch’s JSONs, it was a pain and it was source of more than one error

      Dependences should be reviewed and audited to make sure they do what you need and they are worth using. Just making everything in-house gets you nowhere most of the time

      • aaro@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        4 months ago

        Nobody is arguing that you should never depend on anything and create everything yourself, but adding a dependency for literally a one liner function is awful. Like one of the Go proverbs goes, a little copying is better than a little dependency.

        • lad@programming.dev
          link
          fedilink
          English
          arrow-up
          1
          ·
          4 months ago

          Yeah, there’s mention of doing the opposite in C++ community in a neighbouring thread

  • Randelung@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    4 months ago

    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.

  • josefo@leminal.space
    link
    fedilink
    arrow-up
    1
    ·
    4 months ago

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

  • EnderMB@lemmy.world
    link
    fedilink
    arrow-up
    1
    arrow-down
    1
    ·
    4 months ago

    I’ve honestly never understood why someone at Google or Mozilla hasn’t decided to write a JavaScript Standard Library.

    I’m not opposed to NPM, because dumb shit like this happens everywhere. If such a package is used millions of times a day, perhaps it would make sense to standardise it and have it as part of the fucking browser or node runtime…

    • dan@upvote.au
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      4 months ago

      someone at Google or Mozilla hasn’t decided to write a JavaScript Standard Library.

      Core APIs (including data types like strings, collection types like Map, Set, and arrays), Browser, and DOM APIs are pretty good these days. Much better than they used to be, with more features and consistent behaviour across all major browsers. It’s uncommon to need browser-specific hacks for those any more, except sometimes in Safari which acts weird at times.

      The main issue is server-side, and neither Google nor Mozilla have a big interest in server side JS. Google mostly uses Python and Java for their server-side code, and Mozilla mostly uses Rust.

      Having said that, there’s definitely some improvements that could be made in client-side JS too.

    • seatwiggy@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      1
      ·
      4 months ago

      There’s a js runtime called bun that is 90-something% feature equivalent to node and also has built in alternatives to many packages like express and bcrypt. I haven’t used it myself so I can’t speak to its quality but it’s always nice to see a little competition

      • jaemo@sh.itjust.works
        link
        fedilink
        arrow-up
        1
        ·
        4 months ago

        Bun is used by us in production, in dev, everywhere. It’s great. We don’t even use (p)npm to build js packages on our docker images for apps anymore.

      • Dr. Moose@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        4 months ago

        So is Deno! You can easily import npm: and node: packages and run typescript without transpiling. With Bun and Deno there’s no reason to use Node tbh.

        • sfxrlz@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          4 months ago

          For starting new projects i absolut agree. At work we have a legacy react app that just will not run on bun and for deno we would probably have to rewrite some stuff.

          • Dr. Moose@lemmy.world
            link
            fedilink
            English
            arrow-up
            1
            ·
            4 months ago

            I’ve updated some legacy nodejs to Deno recently and it’s actually not bad! If you’re using serverless Denoflare is super convenient and DTN is a tool for building Deno to NPM (both esm and commonjs) so you can have easy backwards compatibility if needed, it even shims all of the Deno standard lib.

            It’s really impressive what Deno and Bun people have done - for the first time I actually somewhat enjoy server side JS!

            • sfxrlz@lemmy.world
              link
              fedilink
              arrow-up
              1
              ·
              4 months ago

              That sounds neat. For our nodejs server this could be done without too much effort. Will keep that in mind, thanks. But I also have to check for the cra app we’re having a lot of issues with.

    • Blackmist@feddit.uk
      link
      fedilink
      English
      arrow-up
      1
      ·
      4 months ago

      Support for int64s out of the box and without jumping through hoops would be nice.

    • DefederateLemmyMl@feddit.nl
      link
      fedilink
      arrow-up
      1
      ·
      4 months ago

      I’ve honestly never understood why someone at Google or Mozilla hasn’t decided to write a JavaScript Standard Library.

      • BlackRoseAmongThorns@slrpnk.net
        link
        fedilink
        arrow-up
        1
        ·
        4 months ago

        This picture honestly looks more like C++ than JS, and before you yell at me, JS doesn’t have any standards let alone competing standards so ¯⁠\⁠_⁠(⁠ツ⁠)⁠_⁠/⁠¯

        • stetech@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          3 months ago

          JS doesn’t have any standards

          ECMAScript would like to have a word with you.

          If however by “doesn’t have any standards” you meant it’s willing to sink to new low grounds every day, you would be correct.

          • BlackRoseAmongThorns@slrpnk.net
            link
            fedilink
            arrow-up
            2
            ·
            3 months ago

            The latter, and the underutilization of the fact that the standard library exists, and consequently the existence of so many micro dependencies.