• melfie@lemy.lol
    link
    fedilink
    arrow-up
    51
    arrow-down
    1
    ·
    1 day ago

    I worked in heavy JavaScript codebases back in the IE days and wasn’t too crazy about it. Then JIT compilers like v8 came along and made it run a lot faster and TypeScript also made it more usable for larger codebases. I now consider TypeScript among my favorite languages. I’ve also written a lot of Go lately, and while I appreciate its speed and smaller memory footprint, the missing language features kind of grate on me and I don’t mind taking a bit of a performance hit for the (IMO) superior ergonomics of TypeScript, especially for workloads where I/O is more of the bottleneck than compute.

    • RagingRobot@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      1 hour ago

      It’s funny because I learned to program with strongly types languages and when I moved over to JavaScript I always complained about it for the longest time but now that I use mostly typescript at work I kind of miss some of the old JavaScript patterns and their flexibility. But for working with large teams or large projects in general it’s nice to have typescript

    • sip@programming.dev
      link
      fedilink
      arrow-up
      17
      ·
      1 day ago

      agreed. typescript is excelent, especially if you make it strict and know a bit of complex types to make sure things stay put.

      • Victor@lemmy.world
        link
        fedilink
        arrow-up
        7
        ·
        22 hours ago

        Chiming in as a professional TS dev. It’s really a joy to do web dev work in the post TS world.

        • biggeoff@sh.itjust.works
          link
          fedilink
          arrow-up
          4
          ·
          12 hours ago

          What do you think of JSDoc? As someone who knows neither I find the idea of no required transpilation very appealing, while still getting the TS ecosystem tools.

          • Victor@lemmy.world
            link
            fedilink
            arrow-up
            4
            ·
            12 hours ago

            JSDoc is much more cumbersome than using TypeScript. That’s it. It clutters the code in a way that TypeScript somehow avoids. TS types are smoothly integrated in the code itself, IMO. Not as much the case with JSDoc.

            • biggeoff@sh.itjust.works
              link
              fedilink
              arrow-up
              4
              ·
              8 hours ago

              Thanks! As a hardware guy it’ll be a long time before I do anything with this information. Nice to hear the opinions of actual Devs.

              • moseschrute@lemmy.world
                link
                fedilink
                arrow-up
                2
                ·
                5 hours ago

                I suspect most Lemmy users hating on JS haven’t done much professional JS work. Especially these days with TypeScript and all the modern conveniences.

                I’m curious, what kinda hardware do you work on?

                • biggeoff@sh.itjust.works
                  link
                  fedilink
                  arrow-up
                  1
                  ·
                  57 minutes ago

                  Digital hardware, mainly top-level design in verilog and associated checks using python/perl (sad)

                  Right now working on a GPU which is fun!

              • Victor@lemmy.world
                link
                fedilink
                arrow-up
                1
                ·
                6 hours ago

                Ah alright 🙂 My pleasure! Yeah I wouldn’t even consider JSDoc if I had the choice of TypeScript. I even did some years of Advent Of Code in TypeScript. It’s performant enough and simple to employ some kind of quasi functional programming style with it. I think it’s great.

                • moseschrute@lemmy.world
                  link
                  fedilink
                  arrow-up
                  1
                  ·
                  5 hours ago

                  I think Rich Harris famously migrated Svelte from TypeScript to JSDoc, while still supporting TypeScript via JSDoc. I don’t use Svelte, so I have no idea how well this works in practice. However, Rick Harris seems smart to me, unlike other overly opinionated devs like DHH. I still wouldn’t use JSDoc over TS, but I guess if it works for your project, who cares. What matters is that we all remember the one true enemy, DHH

                  • Victor@lemmy.world
                    link
                    fedilink
                    arrow-up
                    2
                    ·
                    3 hours ago

                    I would actually love to hear the rationale behind migrating from TypeScript to JSDoc. Mind boggling to me.

                    Especially nowadays when there is promising work towards very fast, Rust-based TypeScript tooling, which web devs are in love with.

                    So yah, very interesting.

                    But yeah, DHH 🖕🖕

            • biggeoff@sh.itjust.works
              link
              fedilink
              arrow-up
              2
              ·
              8 hours ago

              Being honest, I’m an outsider looking in. Most likely these things are solved problems, but alternates are always interesting to hear insider opinions on.

              Sounds like it’s developer experience Vs required post processing in this case, which is a reasonable tradeoff to think about

        • sip@programming.dev
          link
          fedilink
          arrow-up
          3
          ·
          13 hours ago

          i wish a more performing language would have this type system. the only other ones I know are Rust which is a bit strict and slow to dev on, and Haskell which is too much.

            • sip@programming.dev
              link
              fedilink
              arrow-up
              1
              ·
              edit-2
              13 hours ago

              I asked chatgpt for a few languages with a good typesystem and it suggested ocaml among other (scala, rust, haskell, f#)

              Then asked for a 100 line ocaml REST API example with a popular framework and db lib… and it looks mostly like Haskell.

              edit: async is done with monads

              • Victor@lemmy.world
                link
                fedilink
                arrow-up
                1
                ·
                12 hours ago

                If it looks mostly like Haskell but has better tooling, I’m in. I have yet to manage to successfully set up a Haskell environment on my own PC. 😅 I am obviously missing something.