• Scoopta
    link
    fedilink
    arrow-up
    43
    arrow-down
    7
    ·
    1 month ago

    As someone who mostly avoids JavaScript, I don’t see the IT in this image, I just see a bad language I avoid!

      • lad
        link
        fedilink
        English
        arrow-up
        6
        ·
        1 month ago

        Albeit true, I want to note that some languages encourage such practices way more than others do. Also, when you’ve got a hammer everything looks like a string nail.

        • blackn1ght@feddit.uk
          link
          fedilink
          arrow-up
          1
          arrow-down
          1
          ·
          1 month ago

          In my mind a simple unit test should have caught this. Mock out the call to the service that sends the message and verify that it’s been called with the correct message, and cover the possible failure scenarios. That said I hate loosely typed languages lol.

      • copd@lemmy.world
        link
        fedilink
        arrow-up
        5
        arrow-down
        1
        ·
        1 month ago

        besides NaN actually being a number, this could completely and easily be avoided with typescript.

        • rooroo@feddit.org
          link
          fedilink
          arrow-up
          6
          ·
          1 month ago

          Naaah. Good programmers know how to use as any as any to make this work in typescript as well.

      • Scoopta
        link
        fedilink
        arrow-up
        2
        ·
        1 month ago

        I’m assuming by this you mean the developers of JS /s

    • JackbyDev
      link
      fedilink
      English
      arrow-up
      4
      ·
      1 month ago

      I promise you, people make mistakes in every language lol.