• traches@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    23
    ·
    11 hours ago

    I don’t get the hatred for types, they have saved my ass so many times and saved so many headaches exactly like what the article describes. I used to write a lot of ruby and after getting decent at typescript I can’t go back.

    It’s not just ceremony, types ensure some level of logical consistency in your app. They reduce how much of the world you need to keep in your head at one time, and they allow you to express your intent far more robustly than comments and naming can. I love rust’s approach of making invalid state not even representable.

  • dohpaz42@lemmy.world
    link
    fedilink
    English
    arrow-up
    15
    arrow-down
    6
    ·
    edit-2
    10 hours ago

    Instead of just doing what I want to do, I’m stuck either doing plumbing work to hold my values and pass them around, or I’m casting things back and forth where I know things are correct but the compiler doesn’t.

    I hate this attitude.

    Instead of doing what you want to do? Dude, unless you’re a hobbyist, you’re being paid to do what your company wants you to do; i.e., it’s not about what you want.

    Stuck doing plumbing work? Yeah, nobody likes plumbing, but we all know it’s necessary. When you’ve got your proverbial shit backing up onto your floor because you cheaped out on plumbing, cry to me then.

    If you’re casting things back and forth, you’re doing it wrong. Spend a day or two and build yourself a solid, consistent foundation, plan ahead, and you won’t be casting things back and forth.

    And no, you obviously don’t know better than your compiler, you arrogant sack of sh…

    Anyway, get over yourself already and just do your damn job better.

    • rglullis@communick.newsOP
      link
      fedilink
      arrow-up
      1
      arrow-down
      3
      ·
      edit-2
      4 hours ago

      How many billion dollar companies were built on dynamically typed languages? Do you think that companies/bosses/investors care about the compiler warnings or whether you can deliver/iterate faster than the competition?

      nobody likes plumbing, but we all know it’s necessary.

      Is it, really? Are we all working on mission critical software? We are living in a world where people are launching usable applications with nothing but the prompt to an LLM, ffs, and you are there trying to convince yourself that pleasing the Hindley-Milner gods is fundamental requirement in order to deliver anything?

      Good engineering is about understanding design constraints and knowing where to choose in a myriad of trade-offs. It’s frankly weird to think that such an absolute, reductionist view like yours got so much support here.

  • TehPers@beehaw.org
    link
    fedilink
    English
    arrow-up
    6
    ·
    10 hours ago

    Types aren’t unit tests. Unit tests only test a discrete set of inputs and outputs for correctness, and can miss cases that aren’t tested for.

    In sound type systems, they are closer to formal verification. The compiler guarantees the properties you expect of the type hold.

    As for the rest of the article, do what works best for you in your projects, but if I need to work with you, I’m going to ask for types. I need to know what types the interface expects to receive. Names are not enough. Document them, use type hints, whatever, just put them somewhere because I’m not psychic and I don’t know what you thought about when writing the function.