• NaevaTheRat [she/her]@vegantheoryclub.org
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 month ago

    In my head I had conflated duck and weak typing. I’m not an oop programmer (tbh I’m not much of a programmer to begin with) and since what Python does e.g. with file handles is closer to say in Haskell making a wrapper

    DataStream x -> FileHandle x

    Where like implementing the read/write/open etc methods are equivalent to implementing the function mappings.

    Which is very different from say JS “Herr durr I’m going to cast an int to a string and then error” I assumed the latter was “duck typing”

    • AVincentInSpace
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      1 month ago

      I don’t know enough Haskell to tell you whether you’re right about that or not (read: I know literally zero Haskell) but that sounds vaguely correct. That said, JavaScript is strongly and dynamically typed as well – it’s just a lot more lenient with implicit type conversions than Python is because of obscure 90s bullshit.

      Also: don’t let anyone tell you you’re not a real programmer. If you even know what Haskell is, you’ve more than passed my bar.