• orangeboats@lemmy.world
    link
    fedilink
    arrow-up
    27
    ·
    1 year ago

    This is why I try my damnedest not to write in weakly typed languages.

    string + object makes no logical sense, but the language will be like “'no biggie, you probably meant string + string so let’s convert the object to string”! And so all hell breaks loose when the language’s assumption is wrong.

    • zalgotext@sh.itjust.works
      link
      fedilink
      arrow-up
      5
      ·
      1 year ago

      You don’t necessarily need types for that kind of thing though, a strict linter that flags that code works just as well