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

    I agree, but I imagine dynamic type fans would say they don’t understand why explicitly stating types can be helpful.

    • sugar_in_your_tea@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      Optional typing is pretty useful, especially if the tooling is such that it catches most issues. I use Python’s optional typing quite a bit, and my general approach is to add types if the function is intended to be reused or if it took more than three seconds to figure out what it does. We also use Typescript, and typing isn’t necessary there either.

      If your type system is too strict, it can be really annoying to work with and make simple things take longer. If it’s too loose, you’ll introduce stupid bugs.

      • basskitten
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        If your type system is too strict, it can be really annoying to work with and make simple things take longer.

        Swift has entered the chat.