I was talking to my manager the other day, discussing the languages we are using at $dayjob. He kind of offhandedly said that he thinks TypeScript is a temporary fad and soon everything will go back to using JavaScript. He doesn’t like that it’s made by Microsoft either.

I’m not a frontend developer so I don’t really know, but my general impression is that everything is moving more and more towards TypeScript, not away from it. But maybe I’m wrong?

Does anyone who actually works with TypeScript have any impression about this?

  • Vincent@feddit.nl
    link
    fedilink
    arrow-up
    145
    ·
    8 months ago

    If TypeScript still is a fad at this point, his definition of fad is far lengthier than mine is.

    I’m fairly sure TypeScript will remain in popular use longer than whatever project you’re working on 😅

  • DannyBoy@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    77
    arrow-down
    2
    ·
    8 months ago

    As long as JavaScript is being used, TypeScript will be used. It makes writing JavaScript tolerable.

        • jeremyparker@programming.dev
          link
          fedilink
          arrow-up
          12
          ·
          8 months ago

          And I’m sure Microsoft would be happy to not have to do it anymore. And I personally would much prefer an actual typing system rather than a glorified linter.

          Tho I wonder if it will end up being like jQuery, in the sense that, by the time core jQuery features got added to vanilla js, jQuery had developed new features that validated its continued existence. Maybe TS will go further than what gets absorbed into JS and keep it alive.

          • aidan@lemmy.world
            link
            fedilink
            arrow-up
            3
            ·
            8 months ago

            Honestly, I’ve never used jQuery despite writing JS for over 10 years. Just because I hate the reliance on massive nebulous packages so many have. Especially when I looked into it years ago, so much of what I saw jQuery being used for was stuff that was extremely easy to implement yourself. How has it changed?

            • jeremyparker@programming.dev
              link
              fedilink
              arrow-up
              1
              ·
              8 months ago

              jQuery is a lot smaller and less nebulous than its competitors (looking at you,React literally every JavaScript framework).

              Jquery was what was popular when i learned js. I’m kinda glad it was, honestly: jQuery is a little unique in that it doesn’t have magic to it the way js frameworks do. Everything you can do in jQuery, you can do in vanilla JavaScript pretty easily. With, say, React, how is a newcomer supposed to understand how a series of React components become HTML?

              So jQuery kept it “real” for me. Fewer abstractions between me and the HTML meant it was easier for me to connect the dots as a self taught developer.

              As for how it’s changed, it’s more any how vanilla JavaScript has changed. A lot of the things that made jQuery so much easier and cleaner than vanilla are now baked in, like document.querySelector(), element.classList, createElement(), addEventListener()… It had Ajax methods that, before jQuery, were a tremendous pain in the ass.

              jQuery was great, but, you basically had to use it with something like PHP, because it had no back end. So when angular came out (and a few others that aren’t around anymore and I’ve forgotten), it allowed you to replace both PHP and jQuery, and developers rejoiced.

              Why did they rejoice? I’m not actually sure there was reason to, objectively speaking. As developers, we like new tech, especially if that new tech requires us to think about code differently, even if, in retrospect, it’s a hard argument to make to say that, if we had just stuck with PHP and jQuery we would be somehow worse off than we are with React.

              Of course, in tech, when a new system changes how we think, sometimes (not as often as we’d like) it helps us reconsider problems and find much more elegant solutions. So, would we have all the innovations we have today if all these js frameworks has never existed? Obviously we can’t really answer that – but it’s a toke of copium for when we get nostalgic for the PHP/jQuery days.

              (Also, for you newer people reading this, you should probably be aware that the PHP/jQuery mini-stack is still very quietly used. You’ll definitely see it, especially in php-baaed COTS.)

              • aidan@lemmy.world
                link
                fedilink
                arrow-up
                1
                ·
                8 months ago

                Thanks for informing me, but I still kinda wonder why someone would use it today?

      • lemmyvore@feddit.nl
        link
        fedilink
        English
        arrow-up
        8
        ·
        edit-2
        8 months ago

        And also JS.

        Well “kill” is perhaps a strong word but it definitely won’t be JS anymore at that point. The changes required to bake in strong type support would be radical.

      • exocrinous@startrek.website
        link
        fedilink
        English
        arrow-up
        6
        arrow-down
        1
        ·
        8 months ago

        That would be a great solution, because while I love Typescript, I hate compiled web code. One of the coolest things about the internet is that as it’s supposed to work, you can download the source code for any website you go to. It’s open source by design. I hate closed source websites and I hate compiled website code that helps close the source it’s quite a contradiction because typescript is awesome and I recognise that compilation is the only way to get it to run on our web infrastructure. So it would be great if we could just type JavaScript and solve the contradiction that way.

        • Lojcs@lemm.ee
          link
          fedilink
          arrow-up
          5
          ·
          edit-2
          8 months ago

          Doesn’t typescript compile to js anyways? Is it obfuscated?

          • lolcatnip@reddthat.com
            link
            fedilink
            English
            arrow-up
            3
            ·
            8 months ago

            It’s not intentionally obfuscated or minified. Generally it just strips out types and comments, but depending on how it’s configured, it will rewrite certain things to work in ES5. At my work our build process uses a separate minification and bundling step, which also serves to a obfuscate our proprietary code.

      • iarigby@lemmy.world
        link
        fedilink
        arrow-up
        3
        ·
        8 months ago

        the can’t add proper typing without adding a compiler. Whatever they add will be closer to puthon’s type hints. I’ve had to write primary in python lately and type hints help very very slightly, and tools like pyright catch so many false errors due to lack of hints in libraries that we’re forced to add ignore statements on too many lines. I genuinely don’t understand how there can be so many languages and all of them be painful to use

          • iarigby@lemmy.world
            link
            fedilink
            arrow-up
            2
            ·
            8 months ago

            yes I heard it’s great. Scala was one language where I didn’t constantly feel like getting hit in the head with a hammer and I’ve heard Kotlin has a similar experience. I’m not interested in Android development so I haven’t tried it

            • BatmanAoD@programming.dev
              link
              fedilink
              arrow-up
              3
              ·
              8 months ago

              Kotlin isn’t just for Android; IMO unless you’re trying to do purely functional programming, it’s preferable to Scala for JVM work.

              • MV (Jerboa dev)@programming.dev
                link
                fedilink
                arrow-up
                1
                ·
                edit-2
                8 months ago

                Yeah anywhere were you would use Java. Scala has a too high adoption cost. Kotlin is better suited for enterprise, has a stronger ecosystem and better interop with Java. I did enjoy scala though when experimented with it. The only thing I missed was the lack of control flow, no labels, continue, break

            • aidan@lemmy.world
              link
              fedilink
              arrow-up
              3
              ·
              8 months ago

              I was able to pick it up extremely quickly. Just basically looking at existing projects. Tbh, I don’t even know how I learned it.

  • hperrin@lemmy.world
    link
    fedilink
    arrow-up
    58
    ·
    8 months ago

    TypeScript might not be here to stay, but typed JavaScript definitely is. I’ve switched to writing 100% TypeScript, and haven’t looked back. The fact that just adding types to one of my (admittedly more complex) libraries surfaced 3 unknown bugs was eye opening to me.

  • redcalcium@lemmy.institute
    link
    fedilink
    arrow-up
    48
    arrow-down
    2
    ·
    8 months ago

    CoffeeScript was a fad, but TypeScript seems to gaining more and more popularity these days, with new runtimes like deno supporting them natively. TypeScript finally gave Microsoft relevancy again in webdev world, so I bet they’ll go a great length to make sure it stays that way. If Microsoft were still making their own browser engine, I bet they’ll make it natively supports TypeScript too.

    • magic_lobster_party@kbin.run
      link
      fedilink
      arrow-up
      42
      arrow-down
      1
      ·
      8 months ago

      CoffeeScript was a fad because it didn’t solve anyone’s problems. It was basically “look how cool code you can write”.

      TypeScript is gaining popularity because static typing solves real problems. It’s also a superset of JavaScript instead of being a completely new language from scratch, which makes it easier for JavaScript devs to learn.

      • brian@programming.dev
        link
        fedilink
        arrow-up
        18
        ·
        8 months ago

        it felt to me like coffeescript solved problems that people had, then js got equivalent features. arguably that could happen to ts as well

        • Bourff@lemmy.world
          link
          fedilink
          arrow-up
          9
          ·
          8 months ago

          Exactly, it was pretty useful until ~2015 imho. Then JS got better, and coffeescript did not follow these evolutions.

    • Eager Eagle@lemmy.world
      link
      fedilink
      English
      arrow-up
      14
      arrow-down
      1
      ·
      edit-2
      8 months ago

      CoffeeScript wasn’t a fad, it just became obsolete because JS adopted the syntax sugar CoffeeScript was selling. In a way, it did its job.

      • flying_sheep@lemmy.ml
        link
        fedilink
        arrow-up
        7
        ·
        8 months ago

        Yup! All of the following features were in CoffeeScript first: Modules, classes, arrow functions, async functions, parameter defaults, …spread, destructuring, template strings.

        So I’d say it was extremely successful in making JavaScript better.

  • shnizmuffin@lemmy.inbutts.lol
    link
    fedilink
    English
    arrow-up
    37
    ·
    8 months ago

    A fad? No, definitely not. TypeScript brings features (and structure) that will /should probably make their way into JS.

    It’s sort of like asking, “does SASS replace CSS” or “is liquid the next HTML?” They’re just implementations of features FE developers want in the core spec of JS, CSS, and HTML.

    • Vincent@feddit.nl
      link
      fedilink
      arrow-up
      18
      arrow-down
      2
      ·
      8 months ago

      that will /should probably make their way into JS.

      Not really, IMHO. The main advantage of TS is that it will help you catch errors without having to run a particular piece of code - i.e. you won’t have to move to the third page of some multi-page form to discover a particular bug. In other words, it helps you catch bugs before your code even reaches your browser, so it doesn’t bring you much to have them in the browser.

      (There is a proposal to allow running TS in the browser, which would be nice, but you’d still run a type checker separately to actually catch the bugs.)

      • 56!@lemmy.ml
        link
        fedilink
        arrow-up
        5
        ·
        8 months ago

        I think the important part is that the syntax will become standardised, rather than being defined by microsoft/typescript, potentially allowing for alternative implementations. It could also make the build step optional in some cases, which is something people dislike about typescript currently.

        • Vincent@feddit.nl
          link
          fedilink
          arrow-up
          1
          ·
          8 months ago

          I think the syntax explicitly won’t get standardised - but the places where syntax can be put will be (e.g. after a : following a variable, before the =). With, yes, the goal of eliminating the build step, but the type checker (which really is just a linter at this point) would still be able to define their own specific syntax. I don’t think it could work any other way either, anyway.

    • BrianTheeBiscuiteer@lemmy.world
      link
      fedilink
      arrow-up
      6
      ·
      8 months ago

      Hoping this is true. The biggest annoyance with typescript is needing some kind of compiler. Haven’t used Bun or Deno very much, both of which natively support TS, but there are still incompatibilities with the way Node does things and how certain modules were built (CommonJS vs ESM). I like writing JavaScript but the tooling is utter crap.

  • porgamrer@programming.dev
    link
    fedilink
    arrow-up
    38
    arrow-down
    1
    ·
    8 months ago

    5 years ago everything was moving to TypeScript. Now everything has moved. Developers are still catching up, but it will be one-way traffic from here.

    I’m guessing your manager thinks TypeScript is like CoffeeScript. It is not like CoffeeScript.

    Also, TypeScript is only the beginning. In the halls of the tech giants most devs view TypeScript as a sticking plaster until things can be moved to webassembly. It will be a long time until that makes any dent in JS, but it will also be one-way traffic when it does.

    • aidan@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      8 months ago

      Developers are still catching up, but it will be one-way traffic from here.

      Honestly I disagree, maybe I exist in a bit of an echo chamber, but it seems like since around ES2020 or so (some) people have been transitioning from TS to write JS with JSDoc and modern JS style rules.

      I’ve basically transitioned to Go for work(where I can), but don’t really mind writing modern JS

  • locke
    link
    fedilink
    arrow-up
    35
    arrow-down
    1
    ·
    edit-2
    8 months ago

    Typescript makes writing Javascript a reasonable thing to do. Your manager is a fad.

  • Lmaydev@programming.dev
    link
    fedilink
    arrow-up
    28
    arrow-down
    3
    ·
    8 months ago

    When anyone in a professional setting says they don’t like having a mega corp supporting something I lose a bit of respect for their opinion tbh.

    Yes we all know mega corps suck.

    But if you’re using anything in a professional production environment that is meant to last in the long term this is 100% what you want.

    • Valmond@lemmy.world
      link
      fedilink
      arrow-up
      6
      ·
      8 months ago

      Some of us are old enough to remember the browser wars and EEE, so I definitely understands not wanting to be sucked into some mega corps eco system with future lock-ins. Often you can’t do anyhhing else, but that doesn’t mean it doesn’t suck.

      • Lmaydev@programming.dev
        link
        fedilink
        arrow-up
        1
        ·
        8 months ago

        Same. Writing sites that relied on IE was always a stupid decision and kinda invalidated the point of writing a web app.

        I think most people knew that and the managers fucked up big time pushing it. At least in my experience.

        But that’s very different to choosing a programming language.

    • aidan@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      8 months ago

      I mean it is fair to say sometimes it depends on the mega corp, if the whole thing relies on one corp if they’re funding dries up then the whole project dies. But I also don’t really think typescript would die without Microsoft now

  • expr@programming.dev
    link
    fedilink
    arrow-up
    27
    arrow-down
    3
    ·
    8 months ago

    No, because raw-dogging JavaScript isn’t something grown-up software shops do.

  • RonSijm@programming.dev
    link
    fedilink
    arrow-up
    23
    ·
    edit-2
    8 months ago

    Javascript is a fad, we should all move to WASM. 🙃

    But no, TypeScript is not a fad. Unless a better “Typescript like” thing comes out - I know how in frontend land people like to make their own substitute framework that does something slightly different than an existing framework - But I don’t really see why anyone would want to make a NewTypeScript, and not just expand existing TypeScript

    • cbarrick@lemmy.world
      link
      fedilink
      English
      arrow-up
      16
      arrow-down
      4
      ·
      8 months ago

      Dynamic typing is not a fad.

      Python is older than Java, older than me. It is still going strong.

      • Dark Arc@social.packetloss.gg
        link
        fedilink
        English
        arrow-up
        8
        arrow-down
        1
        ·
        edit-2
        8 months ago

        Python also has a statically typed option these days.

        Edit: Previously said “strongly” instead of “statically”

            • FooBarrington@lemmy.world
              link
              fedilink
              arrow-up
              2
              ·
              8 months ago

              Ah, gotcha, thanks! I’d have loved a strongly-typed option.

              The static typing system is slowly getting there, but many useful Python patterns can’t be expressed yet. You can, for example, write a function that appends an item to a generic tuple - but you can’t concatenate two tuples. I really hope they keep expanding on the system!

                • FooBarrington@lemmy.world
                  link
                  fedilink
                  arrow-up
                  2
                  ·
                  8 months ago

                  No:

                  $ python 
                  Python 3.10.13 (main, Jan 28 2024, 03:02:00) [GCC 13.2.1 20230918 (Red Hat 13.2.1-3)] on linux
                  Type "help", "copyright", "credits" or "license" for more information.
                  >>> def handle_foo(value: list[int]) -> bool:
                  ...     return 42
                  ... 
                  >>> print(handle_foo(False))
                  42
                  
      • hascat@programming.dev
        link
        fedilink
        English
        arrow-up
        7
        arrow-down
        1
        ·
        8 months ago

        This just blew my mind. I had always assumed Java was older. I started writing hobby projects in Java in the 90s. I don’t think I heard about Python until the early 2000s.

  • nick@campfyre.nickwebster.dev
    link
    fedilink
    English
    arrow-up
    23
    arrow-down
    1
    ·
    edit-2
    8 months ago

    Hi, I’ve been doing TypeScript in my day-job and hobbies for six and a bit years now. I would not write JS in any other way.

    TS is also a superset of JS so all JS is valid (unless you turn on strict mode). So there is no productivity loss/learning curve unless you want there to be.

    In fact, a lot of people who think they’re not using typescript are using it because their editors use typescript definitions for autocomplete and JSDoc type signatures are powered by typescript.

    • aidan@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      8 months ago

      So there is no productivity loss/learning curve unless you want there to be.

      It’s not significant but an extra build step can be annoying

  • Zannsolo@lemmy.world
    link
    fedilink
    arrow-up
    21
    arrow-down
    1
    ·
    8 months ago

    I’ll riot if I ever need to write pure js again. 98% of web devs would be better served writing in TS. If you’re actually knowledgeable enough to write more efficient js, more power to you but honestly I was probably being generous saying 2% of web devs fall into that category.

    • shastaxc@lemm.ee
      link
      fedilink
      arrow-up
      2
      ·
      8 months ago

      Even then, it just leaves behind an illegible mess that the next dev has to gut and replace with typescript later. If someone wants to use JS on their hobby project, go for it. The extra tools that types enable are super valuable for a team.

  • treechicken@lemmy.world
    link
    fedilink
    arrow-up
    19
    ·
    edit-2
    8 months ago

    I hope not. I’m pretty sure me and my coworkers would be at each others’ throats if it were not for some form of typed JS holding our Frankenstein codebase together.