• shilangyu (lemmur)
    link
    13
    edit-2
    3 years ago

    I’m so bored of people bringing up NaN !== NaN when talking about “javascript’s wonkiness”. This is defined by IEEE for the floating point standard and it appears in any other language using IEEE 754 (which is the majority)

    • @handvat
      link
      53 years ago

      You shouldn’t attempt comparing 2 floating point numbers with simply == (or === in JavaScript) in most cases and in most languages anyways.

    • @spytfyre
      link
      13 years ago

      Totally agree. Moreover I can not think of a valid scenario where you would use such a comparison

  • @blank_sl8
    link
    103 years ago

    Meh, not a great article. It gets off to a pretty poor start by stating that Typescript is “risky” because it has to interact with third-party APIs that are inevitably not written in Typescript. But really, it’s still a lot less risky compared to raw JS.

  • shilangyu (lemmur)
    link
    83 years ago

    A reason not mentioned here which is the only reason I would not use TS is the setup it requires just to get started

  • Mobocratic Egoist
    link
    fedilink
    73 years ago

    I think most are fair points, except I disagree that static types are not helpful. Static typing is preferable over dynamic typing but is difficult to do well. PHP and Python have type annotations now, and I think it would be good if JS introduced them as well. That would be a better solution than TypeScript.

    • shilangyu (lemmur)
      link
      6
      edit-2
      3 years ago

      It would seem to me that introducing typing to JS like in Python or PHP would just end being TypeScript, so why would it be a better solution? Do you mean it being a first class citizen in the JS world?

      • Mobocratic Egoist
        link
        fedilink
        43 years ago

        Yes, I mean making it a first class citizen of standard JS. That would be a step towards all JS libraries coming with type annotations without having to convert everything to TypeScript.