• aluminium@lemmy.world
    link
    fedilink
    arrow-up
    13
    arrow-down
    3
    ·
    10 months ago

    Typescript. Its pretty good and feature compleate overall, but has by far the most flexible typesystem.

    • spikespaz@programming.dev
      link
      fedilink
      arrow-up
      7
      arrow-down
      2
      ·
      10 months ago

      It has by far the most broken type system which is basically a facade for the programmer to feel safe

        • realharo@lemm.ee
          link
          fedilink
          arrow-up
          2
          arrow-down
          1
          ·
          edit-2
          10 months ago

          On one hand, this is definitely a gap, on the other hand, you are very unlikely to run into it in practice.

          The whole “pass an array/object into some function that will mutate it for you” pattern is not very popular in JS , you are much more likely to encounter code that just gives you a new array as a return value and treats its arguments as read-only.

          If you validate your data at the boundaries where it enters your system (e.g. incoming JSON from HTTP responses), TypeScript is plenty good enough for almost all practical uses.