• flamboyantkoala@programming.dev
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    Typescript has many shortcomings. About every language does. But it’s an undeniable very strong benefit that you can code the front and backend with it easily. It runs everywhere. It’s reasonably fast, for aws lambdas I found it had really good cold start time. I suspect because node is built on V8 which is highly optimized to get code running asap.

    That accessibility and versatility makes it in my opinion the best general purpose language right now.

    • philm@programming.dev
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      In backend I’m absolutely happy I can avoid it, there are more solid and more performant languages. I just can’t program in the style I want without loosing massive performance in java/typescript, like in a functional composable style, it results in a mass of allocations, I hate it (because it looks cleaner and is a better architecture IMHO). Rust does a much better job here… I’m also not a huge fan of the type-system, it’s super flexible, but has some incoherence, you tend to overengineer your types, no real ergonomic algebraic data types etc. It also has so many weird design decisions (e.g. prototypal inheritance) I don’t understand and don’t like…

      I think Rust comes probably from the other direction, I can soon write my frontend in Rust without having much ergonomic loss (lets be honest, UI frameworks are currently more “solid(js)” in typescript than Rust, but I think that may change in the future…)

      • flamboyantkoala@programming.dev
        link
        fedilink
        English
        arrow-up
        2
        ·
        1 year ago

        Probably should clarify. I think there are better languages in design and safety for backend.

        However when it comes to a language you can pick up and crank out code for JS/TS is hard to beat. There’s libraries for everything and if your a full stack dev your probably really familiar with all the ends and outs.

        If I have time and I want to make a solidly engineered product Rust is a better option. But often I’m pressed for time and TS can make a solid enough and performant enough product.

        • philm@programming.dev
          link
          fedilink
          English
          arrow-up
          1
          ·
          1 year ago

          Do you have equivalent experience in both? I consider myself being faster in Rust nowadays than in Typescript (most likely because of the good tooling and the nice composable way the language is built.) But it probably depends on the type of the task I guess (e.g. if good libraries are available). But this stands obviously only in backend, writing UI as fast as with React or Solidjs or Svelte or vue or whatever (damn there are just too many frontend frameworks…) is certainly faster in Typescript.

          • flamboyantkoala@programming.dev
            link
            fedilink
            English
            arrow-up
            1
            ·
            1 year ago

            Nah not equivalent. I’ve worked on rust for side projects and a few lower level networking things. Hard to get equivalent experience because my regular job is probably 60% frontend webapps.

            Typescript being everywhere with strong libraries for even brand new tech is why I think it’s a great general purpose language. Whatever new product I’m integrating with always has a JS or TS library.

            You don’t have to convince me Rust is a better language in so far as what it provides the programmer to make a working and correct program but I’d argue it’s not the best general purpose yet for many reasons that go beyond the design of the language and engineering. Such as availability, clients who pay me for code, and third party libraries