• El Barto
    link
    fedilink
    1410 months ago

    Tl;dw: it’s too much “type-gymnastics” when developing a library.

    • mo_ztt ✅
      link
      fedilink
      English
      2710 months ago

      I clicked, sorta interested in the topic because as it happens I just abandoned Typescript in favor of learning Go for a little nascent project I’m working on. (We do these things not because they are easy, but because they eventually will be good which Typescript+Node apparently never will for my particular project.) Then I saw it was Fireship and clicked back away.

      Now it sounds like you’re saying that what they’re claiming is the issue is the one good thing that happened with Javascript in the last however-many years. Yes, it’s a little tedious to have to straighten out all your types. You know what’s more tedious than that? Having to straighten out all your types, but not getting any feedback about it at compile time and having to figure it out based on mysterious failures, or if you’re lucky explicit exceptions, at runtime.

      Having worked for a while in Javascript, and now for a pretty short time in Typescript, I cannot imagine trying to make a decent-complexity project in pure Javascript. That I believe is why they tend to not really be all that object-oriented and pass strings around for lots of things and be sorta flaky.

      • @atheken@programming.dev
        link
        fedilink
        English
        13
        edit-2
        10 months ago

        Yeah, dropping typescript and then codifying type information in jsdoc is comical.

        The only thing I would say about your experience is that “dropping TS for go” is a little bit misleading, and it doesn’t really sound like it bears on the general debate of “TS vs. JS” - go and other static languages generally fit a different niche in my opinion, and can be a better option for certain kinds of systems.

        If you’re building anything of even moderate complexity, or with more than one person, you really need the types and modularity that TS provides.

        I guess it’s also worth noting that JS has actually been influenced/adopted some key features from TS over the years, so it’s possible to do a few things with it to make stuff that’s a bit more maintainable.

        • mo_ztt ✅
          link
          fedilink
          English
          410 months ago

          Yah, 100% agree. So in my case, Typescript is actually a better fit niche-wise… but I finally reached the point where I didn’t want to cope anymore with flawed things it was inheriting from Javascript, so it was especially ironic to me when I saw this and thought maybe I’m not the only one, only to discover that the message was “SIIIKE we love the flawed things! It’s the improvements we’re getting rid of.”

          I mean every project is different and they’ve got a right to do what they want. It was just a hilarious surprise for me.

    • huntrss
      link
      fedilink
      410 months ago

      Too be frank, it is pretty short but your summary is on-point. I would only add, that Svelte also dropped it due to the additional compile step.

      However TS can still be used in most of the frameworks including Svelte.

      • @alokir@lemmy.world
        link
        fedilink
        810 months ago

        I wonder how Svelte’s code is built to make this tradeoff worth it. I’ve been using TS for a long time and in every project the compilation part was the shortest task in the whole build process, especially when you compare it with bundling or running unit tests.

        • phiresky
          link
          fedilink
          510 months ago

          If that’s what this video is about then it’s a lie (I’m not going to watch that bait). Svelte did not move away from Typescript. Svelte just moved from TSs custom syntax to TS-in-JSDoc. They are still using the same types and TS compiler to fully enforce type checking their code.

          Their reason isn’t that TS is bad, just that the IDE experience is bad redirecting you to .d.ts instead of source files for libraries.

        • huntrss
          link
          fedilink
          310 months ago

          Afaik it had more to do with another layer of abstraction then with compike time.