• Phen@lemmy.eco.br
      link
      fedilink
      arrow-up
      3
      ·
      edit-2
      1 年前

      Who the hell doesn’t use namespaces or enums

      Uhhh, typescript devs? Enums were useful once, but typescript evolved everything else around it and these days using direct values is actually far better.

      And I don’t think anyone uses Namespaces other than for defining external modules.

      • TheCee
        link
        fedilink
        English
        arrow-up
        1
        arrow-down
        1
        ·
        edit-2
        1 年前

        deleted by creator

    • rockstarpirate@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 年前

      Yeah it’s interesting because JS is interpreted, not compiled. The proposal allows for type annotations in the syntax but no actual interpreter consequences. On the one hand that makes sense because otherwise you’re in the territory of runtime type-checking which would be a huge performance hit and would sort of defeat the purpose of static types anyway. But that means you still have to rely on your IDE or a linter for this to be useful.

    • fidodo@lemm.ee
      link
      fedilink
      arrow-up
      2
      ·
      1 年前

      I don’t see any practical use case for it as is as anyone wanting to use them would want the full TS feature set anyways, but I could see it being a good step forward for more meaningful features to be added in the future.