Big projects are ditching TypeScript… why?

แชร์
ฝัง

ความคิดเห็น • 2.6K

  • @allinvanguard
    @allinvanguard ปีที่แล้ว +5875

    Well if JavaScript receives native typings, did TypeScript really die or has JavaScript become TypeScript?

    • @snk-js
      @snk-js ปีที่แล้ว +226

      I think the difference is that js will still not being checked at one more compiler step. Typescript is still valid even when js with types comes in

    • @j.r.r.tolkien8724
      @j.r.r.tolkien8724 ปีที่แล้ว +190

      There's a slight difference between type annotations and Typescript. Many front end frameworks use Typescript for much more than just adding type checking. There's tooling with a huge ecosystem built around TS, there's type inference, there's also optimization and compilation which are necessary to a lot of projects. I don't see how adding type annotations could eliminate the need for all the advantages that TS provides but either way it would be a great improvement to other projects that don't require TS in the first place.

    • @KineticFaction
      @KineticFaction ปีที่แล้ว +49

      Turns out Embrace, Extend, Extinguish is still the MO.

    • @yamiteru4376
      @yamiteru4376 ปีที่แล้ว +19

      From Microsoft's point of view it died.

    • @andreilucasgoncalves1416
      @andreilucasgoncalves1416 ปีที่แล้ว +30

      Typescript allows you to use future Javascript in older browsers and allows to use things like JSX.
      JSX will probably never be in the browser natively because many frameworks compile it in different ways like JSX runtime, SolidJS, InfernoJS

  • @aspacegamer92
    @aspacegamer92 ปีที่แล้ว +4596

    optional types in vanilla js would be amazing honestly

    • @XDarkGreyX
      @XDarkGreyX ปีที่แล้ว +15

      ​@@IronCandyNotesnot gonna recheck but I think it's supposed to be in comment format as well

    • @andreilucasgoncalves1416
      @andreilucasgoncalves1416 ปีที่แล้ว +29

      In my opinion they should not implement optional types in Javascript, because it will just make Javascript parsing time slower, they should instead allow to transform the file on the fly so you can use esbuild, flow or any other build tool easily and if you are worried about performance you should use a bundler anyways

    • @vitorfigueiredomarques2004
      @vitorfigueiredomarques2004 ปีที่แล้ว +50

      ​@@IronCandyNotes They will not create a new type system but only make JS able to ignore type annotation with some keywords (like interface and type) and with some special syntax (like colon after a variable). This proposal will be based on the typescript syntax, since is the most established solution for JS.

    • @megistusable
      @megistusable ปีที่แล้ว +7

      Fable with F# is a hidden gem ..

    • @yugshende3
      @yugshende3 ปีที่แล้ว +20

      I think this is the way yes. that’s how python did it and frankly as a Java developer coding in python type annotations was really fun it felt like I actually had to care about how I declare my functions.

  • @notarandom7
    @notarandom7 ปีที่แล้ว +1367

    I personally use TypeScript for the compiler, so that I can catch bugs without losing money at production, because of my terrible code

    • @aberba
      @aberba ปีที่แล้ว +37

      1) typescript can't help you with logical financial error
      2) there are better ways to write financial code

    • @GeorgeSukFuk
      @GeorgeSukFuk ปีที่แล้ว

      That's stupid

    • @theseangle
      @theseangle ปีที่แล้ว +152

      ​@@aberbawhat does this have to do with what he said 🤔

    • @notarandom7
      @notarandom7 ปีที่แล้ว +34

      @@aberba well that's not the point, it's that you can catch errors before production in the first place

    • @FrankLloydTeh
      @FrankLloydTeh ปีที่แล้ว +57

      I work with large corporations and deadlines are a thing. I have never worked in a project with 100% perfect test coverage. When project deadlines are tough, unit tests are the first things to get dropped. The build step has always saved us from someone unintentionally removing/renaming/refactoring something that will only be apparent at runtime.

  • @dekerta
    @dekerta ปีที่แล้ว +276

    I think a lot of complaints about TS come from people designing their code like it's still dynamically typed. Like Fireship's code example at 1:53. Why would you make the value parameter in your callback either T or an empty array? And the function either returns void or another function? Union types should be used sparingly because you're introducing a lot of complexity, and now you have check all of those values in runtime

    • @adtc
      @adtc 9 หลายเดือนก่อน +31

      I love TS because once you tell it what type something should be, it will proactively prevent you from making a mistake. These mistakes can cost you hundreds of man-hours if we're coding in untyped JavaScript...

    • @pharmajoe990
      @pharmajoe990 8 หลายเดือนก่อน +23

      Dynamic types are great for enabling speed at development, it removes a layer of complexity from writing code. The problem with that is when a codebase becomes large enough, refactoring and debugging becomes much more difficult. Types also add a level of self documentation about the code.
      Having worked on >100k lines JS codebases, and having to debug type casting issues 7 function calls deep, I would much rather have types declared.
      But hey, whatever works for you is the right choice.

    • @alexberezkin
      @alexberezkin 7 หลายเดือนก่อน

      Folx just want to write crappy code and then blame TS that it resists

    • @Leonhart_93
      @Leonhart_93 7 หลายเดือนก่อน +5

      Because some functions are generics and you intent to use them with pretty much any data type. Like for example how arrays can be formed from any data type, so a function performing an operation on one could receive any data type at all. I don't want to write 5 duplicate definitions for the same function.

    • @renato_n.n
      @renato_n.n 7 หลายเดือนก่อน +1

      @@Leonhart_93 you could create an alias type as the union of your 5 types and only write the function once

  • @lionelrowe617
    @lionelrowe617 ปีที่แล้ว +305

    Svelte is a great example of how to move away from TS based on well-defined engineering reasons, with clear communication, and in a graceful way that maintains compatibility. Turbo is a great example of how to ditch TS based on pure vibes, with terrible communication, and not even bothering to think about compatibility.

    • @mx-dvl
      @mx-dvl ปีที่แล้ว

      By the way Svelte 4 out now already is using JSDoc, no need to wait for Svelte 5

    • @OnePlusky
      @OnePlusky ปีที่แล้ว +18

      TS and ES6 class hierarchy were introduced basically for web developers coming from strong types langs like Java and C# who want to migrate their code patterns to js instead of learning the lang well. In my opinion the worst thing that happened to js env

    • @eneiromatos5040
      @eneiromatos5040 ปีที่แล้ว +14

      ​@@OnePluskynah, classes in JS are a cool way to abstract the internals of the prototype chain and make the language more friendly, as async/await did the same with promises that did the same for callbacks when ES6 was released.

    • @maelstrom57
      @maelstrom57 ปีที่แล้ว +32

      @@OnePlusky Tell me you're a noob without telling me.

    • @wiredelectrosphere
      @wiredelectrosphere ปีที่แล้ว +52

      Turbo’s explanation was basically “Typescript prohibits us from writing shit code and It gives us headaches so we remove It”

  • @conundrum2u
    @conundrum2u ปีที่แล้ว +1504

    I went to the MS Build conference where TS was first introduced. it was intended to be a temporary measure until types in javascript were a part of the language standard. I really blame the JS committee on this one for letting it take so long. if you're doing type gymnastics, it's probably a huge code smell that what you're doing is overly complex and you need to shuffle around some responsibilities or do better dependency injection and resolution

    • @okie9025
      @okie9025 ปีที่แล้ว +114

      "shuffling around dependencies" will not solve typing problems. Think of config objects - I'd much rather have "type gymnastics" in the type definition than "config: object".

    • @JanVerny
      @JanVerny ปีที่แล้ว +160

      I tend to hate those "you're doing something wrong" type of responses, but yeah, everytime I had to do some overly complex type bs, it was because I used something incorrectly or I just didn't think about what I'm doing. It's also why ditching types is the worst move ever. You're just setting yourself up for a rude awakening.

    • @azufendusgarendum6583
      @azufendusgarendum6583 ปีที่แล้ว +14

      I have had occasions where writing an API I could either not get the adequate types for consumers or I could engage in type gymnastics... It's honestly a difficult thing to manage sometimes

    • @conundrum2u
      @conundrum2u ปีที่แล้ว +11

      @@okie9025 dependencies are not responsibilities. you're still dependent on a domain class to do the work, but if your domain class is doing too much and crazy abstraction into generic types is your goto solution, it's time to sit back and think about the architecture of your classes and the responsibilities that they hold and maybe move those around and flatten the hierarchy. what a lot of people aren't understanding about type safety is that the IDEs are much better at finding duplicate code blocks than ever before and you don't get that with vanilla JS. to be clear, i'm for type safety. i've worked in too much duck typing codebases to see the nightmares it causes in esoteric bugs

    • @ZhilBear
      @ZhilBear ปีที่แล้ว +21

      Good luck assigning a workable type to higher order functions without at least some type gymnastics and heavy doses of generics. Shuffling stuff around a bit is fine if your codebase is object-oriented, but there's a lot of codebases out there that aren't.

  • @aqwaexp
    @aqwaexp ปีที่แล้ว +434

    The matter is very simple.
    Types exist no matter what.
    You can put them:
    - in your code
    - in your mind
    It's up to you which one is better.

    • @AlexandrosFotiadis
      @AlexandrosFotiadis ปีที่แล้ว +35

      In you mind, you are more valuable as a software developer

    • @LukasLiesis
      @LukasLiesis ปีที่แล้ว +79

      mind is way more expensive resource then cpu/ram, so only real option is more broken code or types in code.

    • @noherczeg
      @noherczeg ปีที่แล้ว +113

      Only if you work alone. The "in your mind" version breaks down with teams.

    • @gosnooky
      @gosnooky ปีที่แล้ว

      code.

    • @finnwestergren8670
      @finnwestergren8670 ปีที่แล้ว +10

      ​@@LukasLiesis typescript does not run at runtime u silly goose

  • @Nonsense116
    @Nonsense116 ปีที่แล้ว +935

    I can't imagine throwing away type safety in a project. I get the build step isnt fun but I can't see the build step and type gymnastics being a bigger headache than the errors that you open yourself up to when going vanilla js.

    • @JoRyGu
      @JoRyGu ปีที่แล้ว +200

      I feel like the build step thing is way overblown. 99% of people writing code in TypeScript will not be impacted by the 3 seconds it takes to compile your code. During local development, using something like ts-node completely obfuscates the build step anyway. Use cases like the ones Rich Harris has with Svelte and SvelteKit are so niche that there is zero reason for most normal application developers to even pay attention to it.

    • @guramguram6706
      @guramguram6706 ปีที่แล้ว +67

      @@JoRyGu build step argument will go away fast since development of alternative Rust based TS compilers continues. For ex. i switched to SWC compiler and it takes 300ms to compile my project when it was 30s on ts-node.

    • @IoIxD
      @IoIxD ปีที่แล้ว +55

      @@JoRyGu This! Are the people at Svelte working on Windows XP notebooks? How is the compile step a significant blow to productivity for them?

    • @elina6969
      @elina6969 ปีที่แล้ว +29

      The build step is a problem for libraries, not applications. Tsc can still type check your JavaScript with types in JSDoc so you get to keep type checking and get rid of the annoying build step.
      Again, this only applies to libraries. There is absolutely no reason not to use TS for applications

    • @panthy4331
      @panthy4331 ปีที่แล้ว

      thats bc it does not do any type checking...@@guramguram6706

  • @kirillnovik8661
    @kirillnovik8661 ปีที่แล้ว +407

    Type gymnastics mostly happen when you try to marry React (or similar component based frameworks) with TS, but outside of the view layer realm TS works like a charm. If TS and React were designed with each other in mind, I think there wouldn't be such push back

    • @aheendwhz1
      @aheendwhz1 ปีที่แล้ว +41

      Angular is a React designed with TS in mind

    • @m13v2
      @m13v2 ปีที่แล้ว +16

      and react brings it‘s own oo language on top of javascript: functional components instead of classes, useState() instead of attributes, hooks instead of methods.

    • @netify6582
      @netify6582 ปีที่แล้ว +21

      Yeah, type gymnastics with TS is real. TS helps but it also brings lot of headache. So in the end it feels like it's just different kind pain. ECMA optional types and JSDoc looks like quite decent approach. Thumbs up for dropping TS!

    • @grenadier4702
      @grenadier4702 ปีที่แล้ว +34

      I used React + TS for at least 2 years and didn't notice and so-called "type gymnasitc". What do you even mean by that?

    • @DarkSwordsman
      @DarkSwordsman ปีที่แล้ว

      @@netify6582 Type gymnastics only exists because not everything is typed. If you actually type everything, there are no gymnastics. Part of the gymnastics is actually people just writing bad code :)

  • @xmine08
    @xmine08 ปีที่แล้ว +42

    You know, I really appreciate that in C++ it's a question of if we can get away with C++20 or if we still have to use C++14. I'm not joking, web dev is just madness even after a decade of proper applications written with this tech.

    • @Spo8
      @Spo8 3 หลายเดือนก่อน +4

      It’s as mad as you want it to be. You don’t have to follow the masses who feel the need to rewrite their codebase entirely for the third time this year because they just read a new medium article and don’t want to do actual work.

  • @marcelosantos5683
    @marcelosantos5683 ปีที่แล้ว +513

    You got me with the "It's not easy to be self employed" 😂

    • @protoxus
      @protoxus ปีที่แล้ว +13

      Glad I wasn't the only one who caught that 🤣

    • @GRBtutorials
      @GRBtutorials ปีที่แล้ว +8

      Yeah, I relate too much to being my harshest critic…

    • @schnecko_o
      @schnecko_o ปีที่แล้ว +1

      came here for this comment !

    • @KRIGBERT
      @KRIGBERT ปีที่แล้ว +2

      Saw it coming a mile away, but still chuckled

    • @TheModernRiot
      @TheModernRiot 4 หลายเดือนก่อน +1

      When you're self employed, Nobody hates you more than yourself.

  • @PristinePerceptions
    @PristinePerceptions ปีที่แล้ว +567

    If your project is large enough for the compile step to take too long, it is large enough to necessitate type safety.

    • @maxwellwellman
      @maxwellwellman ปีที่แล้ว +11

      or you can use esbuild instead of tsc

    • @aloysiuskurnia7643
      @aloysiuskurnia7643 ปีที่แล้ว +4

      ​@@maxwellwellmanWhoa whoa whoa. I always used esbuild and I know and love that it is way faster than Webpack and many other bundler. But is it really faster than tsc?

    • @andreilucasgoncalves1416
      @andreilucasgoncalves1416 ปีที่แล้ว

      @@aloysiuskurnia7643 if you use esbuild without vite it will be a lot faster than all alternatives, but if you use Javascript plugins like babel the performance will be almost the same because plugins slow down the bundler

    • @JohnDoe-my5ip
      @JohnDoe-my5ip ปีที่แล้ว +66

      So many noobs haven’t had the intense misery of debugging a large Python or vanillaJS project and it shows… they just hate that they lack the skill to get their code to compile. Well your bugs are still there, they’re still gonna bite you later, and it’s gonna be like pulling teeth to find them. Good luck with that

    • @DeadOce4n
      @DeadOce4n ปีที่แล้ว +2

      @@aloysiuskurnia7643 it actually is orders of magnitude faster, mostly because it's written in Go (tsc is written in TS), and because it doesn't do type checking.

  • @MK-D-O
    @MK-D-O ปีที่แล้ว +274

    I'm a simple man: I see a Fireship notification and I leave the flight cabin, take my parachute and watch it.

    • @normangadenya5149
      @normangadenya5149 ปีที่แล้ว +1

      😂😂😂😂😂

    • @ChrisCarlos64
      @ChrisCarlos64 ปีที่แล้ว +3

      10 minutes later response, I hope you remembered to open the chute in time.

    • @jeffreyrujen
      @jeffreyrujen ปีที่แล้ว +3

      Fireship notification in flight?

    • @warrenarnold
      @warrenarnold ปีที่แล้ว +1

      ​@@ChrisCarlos64You guyz have shutes!😮

    • @josk8936
      @josk8936 ปีที่แล้ว

      I'm more of a productivity guy and skip the parachute step!

  • @HarryRonchetti
    @HarryRonchetti ปีที่แล้ว +33

    It'd be amazing to see a JSdoc tutorial exploring the various options available

    • @robinparadise
      @robinparadise ปีที่แล้ว

      copilot does it automatically 😂, don't need to learn it. I use typescript only in my editor, in my code ❌, any ms to my build is a waste of resources ⚡

    • @maelstrom57
      @maelstrom57 ปีที่แล้ว

      There's like 5 options altogether, no need for a tut.

  • @tomgates3250
    @tomgates3250 ปีที่แล้ว +49

    I think native optional type annotations are a great idea, python also has that and it makes understanding your code after a week of not looking at it much easier

    • @ajaygco
      @ajaygco ปีที่แล้ว +2

      If you need to "try" to understand your code after a couple of days, you did not write it properly in the first place.

    • @PanduPoluan
      @PanduPoluan ปีที่แล้ว +19

      ​@@ajaygcoA couple of days, maybe too soon. But down the line, weeks or months after, when your brain has switched gear to a different project, all those annotations will help.

    • @PhthaloJohnson
      @PhthaloJohnson ปีที่แล้ว +3

      I really don't like the way it's done in python. I also don't understand why being forced to include types is such a terrible thing.

    • @tomgates3250
      @tomgates3250 ปีที่แล้ว +2

      @@PhthaloJohnson I also thing python type annotations are ugly. I really like how it's in C#

    • @ojajebie
      @ojajebie 5 หลายเดือนก่อน

      ​@@ajaygcotell me you are junior programmer without telling me you are junior programmer

  • @karmatraining
    @karmatraining ปีที่แล้ว +1162

    I love that JS developers are beginning to enjoy the journey of madness that C++ developers experienced in the 90's when everyone turned into an architecture astronaut and started templating the shit out of everything they did

    • @yeicore
      @yeicore ปีที่แล้ว +153

      *Java devs using interfaces and singletons as of there was no tomorrow*

    • @darshplaysmc1015
      @darshplaysmc1015 ปีที่แล้ว +189

      @@yeicore As a java dev, I can confirm I make an interface and a class for every line of code I write.

    • @salvatoreshiggerino6810
      @salvatoreshiggerino6810 ปีที่แล้ว +37

      @@yeicore Interfaces are based and singletons would be all right if there was a sane syntax for it. But the 'extends' keyword is the single worst feature of the whole language and needs to be deprecated entirely.

    • @tiredfox2202
      @tiredfox2202 ปีที่แล้ว +5

      ​@@salvatoreshiggerino6810what singletons are you referring to?
      something tells me it's not the design pattern

    • @awawus
      @awawus ปีที่แล้ว +35

      everyone complains about advanced language syntaxes that are only required when writing something very general like a library and wants a solution that can work even for a child but nobody has come up with one. Maybe it's about time that we recognize writing a library is inherently difficult and actually try to improve one's language skills.

  • @FiksIIanzO
    @FiksIIanzO ปีที่แล้ว +404

    "You have to be open-minded and be able to adapt"
    Of course. Only took the guy the better part of a decade to adapt. Absolute adaptability.

    • @ultimaxkom8728
      @ultimaxkom8728 ปีที่แล้ว +27

      Adaptability of a tar.

    • @chri-k
      @chri-k ปีที่แล้ว

      @@ultimaxkom8728tar can adapt to any situation, maximizing it’s ability to ruin everything

    • @Thorax232
      @Thorax232 ปีที่แล้ว +11

      And for the Next decade he's gonna be fighting AJAX form submissions with the Remix experiment. Because form actions are a "web standard" and AJAX isn't.

    • @mage3690
      @mage3690 ปีที่แล้ว +24

      It took him a whole decade to learn that weak, dynamic typing in a general-purpose programming language is a Bad Thing? Damn. I've literally never met a weak, dynamically typed language that I actually liked. Either they're arcane, verbose, or they have TABLES (sorry, the Lua hate just popped out). There's no middle ground anywhere.

    • @DantevanGemert
      @DantevanGemert ปีที่แล้ว +4

      ​@@mage3690hey! No hate towards Lua or its tables! 😠

  • @myahiaoui
    @myahiaoui ปีที่แล้ว +291

    Types in code aren't just syntax; they're your roadmap. They clarify intent, serve as inline guides, and are the building blocks for exponential growth in your projects.

    • @sw1ndler29
      @sw1ndler29 ปีที่แล้ว +26

      no, they're just syntax

    • @rustygear447
      @rustygear447 ปีที่แล้ว +6

      Overrated

    • @marcospenadev
      @marcospenadev ปีที่แล้ว +31

      ​@@monad_tcpif your project is big enough you'll cry for those semantics

    • @sw1ndler29
      @sw1ndler29 ปีที่แล้ว +2

      ​@@monad_tcp No its just syntax

    • @m4rch3n1ng
      @m4rch3n1ng ปีที่แล้ว +14

      and that's exactly why svelte is not dropping types, they are just dropping the typescript language and using jsdoc

  • @dumbfailurekms
    @dumbfailurekms 8 หลายเดือนก่อน +4

    THE STOCK FOOTAGE OF PEOPLE BANGING LAPTOPS WILL NEVER GET OLD

  • @Cenot4ph
    @Cenot4ph 11 หลายเดือนก่อน +7

    We moved to TS because it's type enforced and you catch type bugs earlier in the development process rather than at runtime.

  • @fayaz2956
    @fayaz2956 ปีที่แล้ว +141

    one of the best things about TS is that I can compile my code to any version of JS while writing it using the latest syntax. I don't have to know whether I'm writing codes for Nodejs or browser, its almost like, "Write once, run anywhere" kinda thing.

    • @andrefig822
      @andrefig822 ปีที่แล้ว +43

      Can't you do that with Babel?? Just need to specify your target, node and/or browser. JS to JS.

    • @AlexanderSemenovForever
      @AlexanderSemenovForever ปีที่แล้ว +9

      write one javascript, write twice typescript...

    • @lodgin
      @lodgin ปีที่แล้ว

      @@andrefig822 You can, yes, but that reintroduces the compile step.

    • @SzymonNowicki
      @SzymonNowicki ปีที่แล้ว +5

      Thats like what any bundler does, parcel, esbuild, even raw swc

    • @pau1phi11ips
      @pau1phi11ips ปีที่แล้ว +8

      Errr, have you only written JS after TS came out? Babel does exactly this for native JS.

  • @UliTroyo
    @UliTroyo ปีที่แล้ว +179

    I NEED type annotations on regular JS. TypeScript is a pretty elegant solution meanwhile, though. (Oh, and I want pipe operators too, while we're making wishlists.)

    • @andrefig822
      @andrefig822 ปีที่แล้ว +6

      pipe operator is at stage 2

    • @swattertroops-yaaa
      @swattertroops-yaaa ปีที่แล้ว

      do you know how compilers work

    • @offroaders123
      @offroaders123 ปีที่แล้ว +2

      Destiny operator, please! My dream wish recently is to get declarative UI code working in plain JS without a framework. Imagine if there was a standardized way in the browser to do things like Svelte allows you to do. Why can't that be a thing like all of the other specs?

    • @albirtarsha5370
      @albirtarsha5370 ปีที่แล้ว

      So you would pipe functions together that you couldn't normally dot chain?

    • @mage3690
      @mage3690 ปีที่แล้ว +3

      ​​@@highiqandrational('true' == true) => false isn't in my head, though. Nor is ([ ] == [ ]) => false. Nor ([0] == [0]) => false. (I picked the worst possible examples)

  • @sphereron
    @sphereron ปีที่แล้ว +185

    Optional typing in python is so convenient. I just type whenever typing is not obvious or can't be inferred

    • @NatoBoram
      @NatoBoram ปีที่แล้ว +85

      Optional typings in Python is a third of the reasons why the ecosystem is so terrible

    • @sneer0101
      @sneer0101 ปีที่แล้ว +15

      ​@@NatoBoramCompletely agree

    • @GSBarlev
      @GSBarlev ปีที่แล้ว +8

      Bingo. I'm a huge mypy Stan, but even I am in favor of omitting type hints (in exchange for detailed docstrings) on a function where I would need to perform "gymnastics" to get the compiler not to complain.
      I also very much appreciate Python's use of Protocols and TypeAliases to allow you to have your cake and eat it too-that is, if type checking is important but would distract from the code flow, you can define a "DuckLike" Protocol in some file out of the way that articulates the exact way the parameter is supported to quack.

    • @jbird4478
      @jbird4478 ปีที่แล้ว +38

      It seems a common thing that duck typed languages all end up having a more sensible type system duct taped on top of it. Makes me wonder why we don't just use statically typed languages to begin with.

    • @Lord2225
      @Lord2225 ปีที่แล้ว +30

      Optional typing is excuse for bad typing system

  • @enkiimuto1041
    @enkiimuto1041 ปีที่แล้ว +10

    I feel like JS will take a page out of Go's book in the future, variables will assume a type and stick to it unless you declare specifically a type. Saves so much time if you do, and people taking this option can compile it.

    • @Äpple-pie-5k
      @Äpple-pie-5k 6 หลายเดือนก่อน

      @dzzzzz3366 because TS was invented by a huge evil anti-open monopoly named Microsoft, and because it's ridiculous to "compile" a script language into another script language when compilation should be into a performant format closer to bare metal performance. TS is still JS whether anyone wants to admit it or not, and the real solution is to face the music and create a new universal language for the web. During the transition period, fix the rot at the core, don't build on top of it like TS does. Fix JS.

    • @sindhal6250
      @sindhal6250 4 หลายเดือนก่อน

      Won't. Different domains mostly. Plus Go has advantages that makes it a perfect solution for very stable back-end. Different niche.

  • @Cyberfoxxy
    @Cyberfoxxy ปีที่แล้ว +13

    i frequently program in both. And i will choose having type annotations any day of the week. My JS project are either
    1. Code within a block. Which you should keep to a minimum, i know setting up the compiler+bundler is a pain in the ass. But when your stuff grows. TypeScript is the answer.
    2. Legacy code. Yeah our old engineer, who lefet the company has written 90% of the infrastructure to in plain JS. With no type annotations whatsoever. I maintain this, and add type annotations. Each annotation can take almost an hour to infer. digging through callstacks and parameter transfers with ctrl+shift+f.

    • @cat-.-
      @cat-.- 8 หลายเดือนก่อน

      Sounds like an absolutely horrible job. Hope it doesn't drain away your love for programming

  • @Japhex
    @Japhex ปีที่แล้ว +67

    The key with Typescript has always been to use it intelligently. I used to think I never needed it, hated on it, just learnt my API's inside out instead from being so deeply engrained in a project and refused to use it. I took a couple of contracts where I was forced to start to embrace it and then saw the obvious benefits for teams. Teams is the most important part here, anyone can go and build something by themselves, be engrained in it and therefore believe they don't need anything more than that, but if you're collaborating on a passion project, a work project or a library, tools like TS make it a billion times easier to see where and when you fuck up. I wouldn't give up those red squiggly lines lightly now. Caveat: I still hate it when someone writes a ridiculously complex type, I personally always think there's a better way of abstracting things before it gets to that stage.

    • @PanduPoluan
      @PanduPoluan ปีที่แล้ว +5

      Indeed. The problem is that people try to do smart code which requires amazing type acrobatics. If that happens, one needs to take a step back and think whether a function that has everything including the kitchen sink is proper.

    • @Japhex
      @Japhex ปีที่แล้ว +1

      @@PanduPoluan couldn't agree more.

    • @Heroselohim
      @Heroselohim 11 หลายเดือนก่อน +1

      Ohh man, best comment about TypeScript here!
      Recently I had to get into projects written in TypeScript written by someone else.
      One of the most amazing things about it is that when it is not your project it's far far cleaner to read from zero to knowing the codebase.
      When you write the code for yourself it doesn't matter what do you use as long as you have some coherence.

    • @armandoalvarado5840
      @armandoalvarado5840 6 หลายเดือนก่อน +1

      >I still hate it when someone writes a ridiculously complex type
      the thing is, with TS there's always a natural pressure to trend in that direction by default.

  • @michaelnsandor
    @michaelnsandor ปีที่แล้ว +45

    Just a clarification, DrizzleORM did not drop TypeScript! They were trolling...

    • @mattsecor736
      @mattsecor736 ปีที่แล้ว +7

      Had to scroll way too far to find this.

    • @shtomcom
      @shtomcom ปีที่แล้ว +2

      Good one. Drizzle ORM is all about TypeScript and is beautiful.

  • @Vim_Tim
    @Vim_Tim ปีที่แล้ว +29

    In the case of Turbo, sacrificing the user experience (library consumer) in favor of the developer experience is a cardinal sin of software development. DHH should know better.

    • @kevinclark1783
      @kevinclark1783 ปีที่แล้ว

      He’s a narcissistic dbag like Musk…he does not care

    • @eugenenahdah
      @eugenenahdah ปีที่แล้ว +1

      so you should know better when user won't even use anything about turbo code, they just import the library and that it bro

  • @darekmistrz4364
    @darekmistrz4364 ปีที่แล้ว +1

    Problem is that people do not want to write tests, they prefer to "compile" their amazing Typescript code because they don't have to write meaningful tests, because amazing green icon on build step said their code is perfect.

    • @ex-xg5hh
      @ex-xg5hh ปีที่แล้ว

      Tests do not replace typescript tho, unless you are willing to test each line of your code base for all possible TypeErrors

    • @darekmistrz4364
      @darekmistrz4364 ปีที่แล้ว

      @@ex-xg5hh You would be surprised what PRs I have seen from "fellow" developers on my team. They have different opinion and typescript compile is already more than they would normally use. (I guess normally is just putting the code straight to production)

  • @niks660097
    @niks660097 9 หลายเดือนก่อน +7

    Javascript runtime bugs is the reason many backends have stopped using node.js and javascript, and you can't say "just write better code" in teams of multiple devs, who'll extend and modify your code.

  • @tehsolace
    @tehsolace ปีที่แล้ว +169

    That kind of decision might work best for a library kit project (React, Svelte, etc), because they don't really run code as much as act as a base framework below a ton of unknown scenarios. Their codebase, while significant, is typically small, relatively speaking. A large end-user application would be silly to drop TypeScript.

    • @oddikaro8236
      @oddikaro8236 ปีที่แล้ว +13

      yep, libraries are pretty static, well defined and testable, but not general applications.

    • @Thorax232
      @Thorax232 ปีที่แล้ว +8

      What? The end-users of libraries depend on types to understand libraries. This is an awful take.

    • @JohnDoe-my5ip
      @JohnDoe-my5ip ปีที่แล้ว +11

      You have it precisely backwards… with a stable library API, why not add types, it’s easy. The reason you don’t want types is because your library design is hot garbage and you keep piling more garbage on top with breaking changes.

    • @jackzugna5830
      @jackzugna5830 ปีที่แล้ว

      Where is the boundary line between large small project?
      In a large project you can use Web Assembly and have more performance with a secure control over the data's type.

    • @Thorax232
      @Thorax232 ปีที่แล้ว

      @@jackzugna5830 "this only works on a small project" is a nonsense argument young people use when they aren't familiar with something. This video is fake news anyway so it doesn't really matter.

  • @theacid1
    @theacid1 ปีที่แล้ว +120

    Having all the basic features of typescript in vanilla JS would be a huge gamechanger.

    • @musashi542
      @musashi542 ปีที่แล้ว +2

      ​@@Luke5100Js IS a proper programming language

    • @musashi542
      @musashi542 ปีที่แล้ว +1

      @@Luke5100 bro just stop your bs , why is it always some elitist with his R opinions

    • @theacid1
      @theacid1 ปีที่แล้ว +6

      @@Luke5100 you are right that the core is weak but you also have to respect that JavaScript was programmed in roughly 10 days 😂. Plus, I wouldn't blame JavaScript so much for the lack of missing features because it was never intended for this. People just started bending and extending JS to make it fit in their projects. I suspect that there might be some deeper reasons why type support is not yet available in JS.

    • @julessteiner9172
      @julessteiner9172 ปีที่แล้ว

      ​@@Luke5100scripting language is a programming language

    • @gileee
      @gileee ปีที่แล้ว

      @@julessteiner9172 A scripting language isn't a programming language. A "program"ming language is used to define a "program", a scripting language is used to define a configuration for an existing program in order for it to do what needs to be done.

  • @wtl912
    @wtl912 ปีที่แล้ว +117

    My guess is that optional types will at some point arrive to JS, just like variables and nested selectors were added to CSS... But may also take time and it will probably not be as robust as Typescript.
    Really, I believe TS usage will just continue growing and it will stay in the market for many years to come.

    • @fortuneosho8137
      @fortuneosho8137 ปีที่แล้ว +1

      Just like python uses type hint for static type analysis

    • @gileee
      @gileee ปีที่แล้ว +15

      ts isn't going anywhere. Library creators are ditching it because they, unlike the users of their libraries, live in generics land where types aren't as useful anyway.

    • @JohnDoe-my5ip
      @JohnDoe-my5ip ปีที่แล้ว

      Optional types are better than nothing, but even those of us who appreciate type systems will often be lazy and omit them when they’re not required. Oh I know what I’m doing, it’s fine… hubris and a lack of consideration for the next person to work on your code are the undoing of us all

    • @gileee
      @gileee ปีที่แล้ว +1

      @@JohnDoe-my5ip They're just switching to jsdocs where instead of writing:
      fun(param: string) {}
      You write something like:
      /*
      params:
      param: string
      */
      fun(param){}
      So they types are in the comment. Considering this is typescript and not an actual type safe language, you get all the same benefits without all the absolutely insane type gymnastics that are often seen in ts libraries.

    • @konradjurk101
      @konradjurk101 ปีที่แล้ว

      It will be more robust than Typescript but will have less features.

  • @henriquezolini
    @henriquezolini ปีที่แล้ว +5

    É importante considerar que, mesmo diante da desaprovação de algumas pessoas em relação às decisões dessas empresas, grande parte do debate em torno deste assunto parece ser motivado mais pelo fanatismo do que por argumentações concretas. O TypeScript, em muitos casos, tornou-se quase uma marca, semelhante à popularidade da Apple, onde muitas pessoas o utilizam sem realmente compreender completamente os motivos. É fundamental lembrar que a escolha entre TypeScript e JavaScript deve ser baseada em uma avaliação criteriosa das necessidades do projeto, em vez de seguir tendências cegamente. Flexibilidade e adaptabilidade são essenciais para garantir que a tecnologia escolhida atenda de fato aos objetivos e requisitos específicos de cada desenvolvimento. Eu fiz um post no inicio do ano sobre o porque eu não utilizo Typescript e porque a empresa onde eu trabalho resolveu retirar o Typescript do projeto. Acho no mínimo interessante ver que outras pessoas/empresas estão adotando a mesma medida.

  • @mickmister
    @mickmister ปีที่แล้ว +3

    So jsdoc helps with function calls, but what about variable declarations that cannot be reasonably done with inference alone?

  • @aram5642
    @aram5642 ปีที่แล้ว +86

    Sure thing, if your project is full of implicit or explicit any, you should definitely ditch TypeScript. It's not good for ya ;)

    • @ahmedmagdy-qg3tb
      @ahmedmagdy-qg3tb ปีที่แล้ว +9

      Well i fucking hate typescript since day one no need for wink emoji.

    • @itishappy
      @itishappy ปีที่แล้ว +13

      ​@@ahmedmagdy-qg3tbstunning and brave 👏

    • @offgridvince
      @offgridvince ปีที่แล้ว +6

      ​@gregor3099 this comment made my day😂 thx

  • @skleon
    @skleon ปีที่แล้ว +7

    Doing "gymnastics" to please the compiler is like writing bogus tests to please the coverage check. The types are there for a reason. You will be type-checked, either in production or during compilation, when you have an incident in production, you'll regret not having a compiler warn you there was a bug in your code.

  • @kylerjohnson988
    @kylerjohnson988 ปีที่แล้ว +88

    I have a deep appreciation for typescript because it made javascript projects more maintainable and facilitated safer refactorings. I've worked with typescript daily since Angular 2 released in 2016 so I know my way around it pretty well. Having been a .NET dev before that and since then in a full-stack role, it's hard to be satisfied with Typescript when you write a lot of code in C# and Go. The type safety you get with those languages make Typescript feel like a hack. I'm even toying with the hot take that typescript IS a hack to make javascript more usable. Still, though, typescript is the best way to write web apps today.

    • @LoganS91
      @LoganS91 ปีที่แล้ว +3

      I think you’re correct in your analysis.
      But I think it is also good not to compare Typescript with other types languages. It acts differently and serves different functions.
      You can do some really amazing dynamic things with typescript that is not possible in typed languages, like Template Literal Types. So I think it is beneficial to view it as a different tool altogether, and it has advantages over other typed languages, precisely BECAUSE it is built on top of an untyped language.

    • @majahanson311
      @majahanson311 ปีที่แล้ว +4

      I actually feel the opposite way about C# vs TypeScript. TS does so much more inference that C# feels like I'm repeating myself constantly. With C#, I kinda see why the dynamic people hate static typing so much, though it has improved its inference capabilities a lot over the years. With TS, I feel like I get the best of both worlds: good type checking without all the repetition. It's almost as good as F#

    • @datoubi
      @datoubi ปีที่แล้ว

      Go only recently introduced generics and still seems to lack behind in terms of versatility

    • @traveller23e
      @traveller23e ปีที่แล้ว +4

      @@majahanson311 C# dev here, and I really wish they'd never introduced var (statically inferred type). Often times during a peer review when I see the result of a method assigned to a new variable of type var I end up having to call the dev who wrote it to ask what type that particular instance of var is.

    • @kylerjohnson988
      @kylerjohnson988 ปีที่แล้ว +3

      @Luke5100 lol I’m 32, but I live in Atlanta, Georgia and .NET is king here. It seems like every tech company is a .NET shop here.

  • @adtc
    @adtc 9 หลายเดือนก่อน +2

    I love TS because once you tell it what type something should be, it will proactively prevent you from making a mistake. These mistakes can cost you hundreds of man-hours if we're coding in untyped JavaScript... People who hate typescript are those who dont see the value of a strongly typed language.

  • @ex-xg5hh
    @ex-xg5hh ปีที่แล้ว +2

    Type annotations proposal doesn't make typescript obsolete, it tries to remove the build step. You still have to typecheck those annotations, that's what typescript is for. The proposal just provides a standard type annotation syntax for implementations to erase.

  • @safebox36
    @safebox36 ปีที่แล้ว +30

    I use something similar to JSDoc for Lua called EmmyLua.
    It's nice, but I'd still prefer a typed alternative like Luau at times because sometimes the IDE doesn't realise two data types don't match until it's actually tested. At a poece of code where other languages would have flagged it before you even tried to run it.

    • @WackoMcGoose
      @WackoMcGoose ปีที่แล้ว +2

      Was gonna say, this sounds a lot like when Roblox adopted Luau as the default (haven't touched Roblox Studio in years, but I kept up with the dev blog). Any time that types aren't directly built in to the fundamental syntax of the language, you're gonna have Undefined Behavior no matter how careful you are, especially once you get into user-defined types (the Instance gameobjects in Roblox) and trying to operate on them directly in code...

    • @safebox36
      @safebox36 ปีที่แล้ว

      @@WackoMcGoose I've heard the language is decent
      just a shame most games and apps still use Lua
      even something like Wren or Squirrel would be more preferable at times for the same performance

  • @kieranwood3594
    @kieranwood3594 ปีที่แล้ว +23

    I've always found if you are being forced into things like type gymnastics so often its causing headaches, most likely you have a code design problem. I learned static typed languages before JS/TS so learned to love and rely on strong typing. And as with anything there's always more than one way to skin a cat so if I'm being forced to do tedious stuff to keep the compiler happy that's a sign I need to take a moment and think about the design of my code. More often than not there's a perfectly elegant solution I just hadn't thought of yet.

    • @maxfridbe
      @maxfridbe ปีที่แล้ว

      well if, your solution is to use Any than so be it, just don't throw the baby out with the bathwater.

    • @Remindor
      @Remindor ปีที่แล้ว +1

      I think what he meant is that using TypeScript, you have to spend additional time thinking about things like what to name the types and whether or not you should have two different interfaces/types to represent two variants of the same input for different functions or just have one interface with optional properties... There are thousands of situations like that where TS forces you to think about the type of things or all the various ways to skin a cat (to borrow your own words) which can be distracting compared to JS where you are 100% focused on pure logic and automated tests; just go straight for the meat...

  • @tigerofdoom
    @tigerofdoom ปีที่แล้ว +133

    As much as I love TypeScript, I get what SvelteKit is doing. I can't speak for the rest of them, but TS is one tool among many. It's a meaningful engineering task to select the right tools for the job based on the software you're writing, the team you have, the audience you're writing for, and the technical realities of the rest of the project.

    • @arturschroeder2430
      @arturschroeder2430 ปีที่แล้ว +12

      Problem starts when you have big project with undocumented types, parameters, you never know what the return type is (unless you check the implementation or console log)
      JS should have introduced types long time ago.

    • @gileee
      @gileee ปีที่แล้ว

      @@arturschroeder2430 They use jsdocs so parameter/return/whatever types are still visible on hover and error checked in IDEs

    • @maximiliandmc
      @maximiliandmc ปีที่แล้ว +4

      @@arturschroeder2430 JS was made not to have types... adding types is like going back... Why use types of a language that was made not to have any types to begin with. Big projects dont require types. Types are only necessary in project which require a lot of complicated functions. I have entire social networks with React and NextJS with pure JS and have no trash boiler plate code. It depends on the priject, not its size.

    • @PanosPitsi
      @PanosPitsi ปีที่แล้ว +9

      @@maximiliandmcbecause obviously it was a mistake, the vast majority of bugs is type related which is insane.

    • @maximiliandmc
      @maximiliandmc ปีที่แล้ว

      ​@@PanosPitsi I find it insane how programmers cant handle basic typing bugs and cant make decent code without type checking.

  • @lord_nikon_010
    @lord_nikon_010 ปีที่แล้ว +2

    Basically in front-end. In the back-end, if you need to do a lot of type gymnastics I believe you need to review your abstractions.

  • @emacsultron6212
    @emacsultron6212 10 หลายเดือนก่อน +1

    There's Typescript for css now, to make css "type safe". Soon they'll introduce Type safe emails and type safe Coca Cola and then debate how we managed the two without "type safety".
    I've seen more frontend webdev teams focusing on type gymnastics instead of things that actually matter - ux, accessibility, performance, functional tests, the fucking output.

  • @willinton06
    @willinton06 ปีที่แล้ว +27

    You can put as much lipstick on the pig as you want but at the end of the day it’s still JavaScript

  • @bob_kazamakis
    @bob_kazamakis ปีที่แล้ว +6

    My understanding of that proposal is for js to ignore type declarations so tools like TS can appear in vanilla JS. Not that it would absolutely remove the need for a type manager

    • @trapfethen
      @trapfethen ปีที่แล้ว +1

      You still won't be able to ship typescript to the browser as the proposal only allows for colon delaminated type declarations on variable declarations and function parameters. You will still have to configure a build step to strip out every other type-related construct. your type definitions, type casts, as const, etc. In addition, this proposal as it stands would preclude the addition of true types into javascript in the future. The syntax will already be in use, and turning these types from runtime ignored to runtime enforced / optimized would break any code utilizing them where the declared types and actual types have drifted apart over time.
      Types should only be added to javascript when they are intended to be a full first-class addition.

  • @alvinkariuki236
    @alvinkariuki236 ปีที่แล้ว +11

    "my boss will abuse me physically and emotionally if I don't code up to his standard"
    "It's not easy being self employed" 😂😂😂 I'm so dead

  • @za_wavbit
    @za_wavbit ปีที่แล้ว +1

    Picking Kent Dodds as an example of someone making good choices is questionable, he changes his mind more frequently than his socks. We even used to joke about it in a previous workplace, "Kent *_C_* Dodds said everyone should switch to X, so it'll probably be abandoned soon." He's right in this case, though. Flow was technically superior, but never reached stability, and types eliminate a huge amount of potential bugs (and unit tests). At this point I can't even imagine going back.

  • @shantanukulkarni8883
    @shantanukulkarni8883 ปีที่แล้ว +1

    "You Either Die A Hero, Or You Live Long Enough To See Yourself Become The Villain"

  • @nickdivona8769
    @nickdivona8769 ปีที่แล้ว +42

    The time I spend writing types saves me far more time down the line. DHH's blogpost reads like someone who tried TS, didn't like it, and now bases decisions off of that one experience. The face that the PR was merged within a few hours of being opened despite the relevant objections is hilarious.

    • @mattymattffs
      @mattymattffs ปีที่แล้ว +5

      He just hates types period

    • @ilyasayusuf5447
      @ilyasayusuf5447 ปีที่แล้ว +8

      its also really help in team projects, i can understand other people code easily by just looking at the types

    • @yeicore
      @yeicore ปีที่แล้ว +4

      He comes from Ruby, so yeah, that would explain a lot

    • @KingThrillgore
      @KingThrillgore ปีที่แล้ว

      dhh has always been like this and it's not surprising he did this. He's an insufferable prick.

    • @disguysn
      @disguysn ปีที่แล้ว +1

      These types of programmers measure code quality on how little code they have to read and write, not in how easy it is to maintain. Rails code often results in unexpected behaviors that are difficult to debug, but at least it looks pretty!

  • @DemPilafian
    @DemPilafian ปีที่แล้ว +8

    Using TypeScript generics in *application code* to perform type gymnastics is generally straightforward. However, using generics in *library code* often requires an additional meta level of mental abstraction resulting in the _twisties._

    • @alanschmitt9865
      @alanschmitt9865 ปีที่แล้ว +2

      I’ve never had the pleasure of writing a lib… how exactly does that change things vs an app?

    • @Dogeek
      @Dogeek ปีที่แล้ว

      @@alanschmitt9865 Because you need to support so many more different types in your generics for a lib than when you write application code.
      Take the example of `const sum = (a, b) => a + b;` it might seem obvious at first for a and b to be numbers, but then you could also add strings to concatenate them, or support number-like protocols for a and b that are not the default number type of javascript...
      The example is minimal on purpose, but in a library, you have to make types stay out of the way. The app can be overly restrictive on the types it can use in its functions, but the library has no idea of the purpose it's being used for, so it has to be more generic, eventually leading to type gymnastics.

    • @DemPilafian
      @DemPilafian ปีที่แล้ว

      @@alanschmitt9865 In an application you generally know the details of what you're passing around whether it's a user object, log event, or db connection. For much of the code you don't need to use generics because all your types are known ahead of time. With library code, on the other hand, you often times have no idea what crazy wacky stuff users might try passing into your library. The challenge is for your library to allow the user's IDE to infer useful type information even though you've never seen the user's type definitions.

  • @armandasbarkauskas4485
    @armandasbarkauskas4485 ปีที่แล้ว +7

    Many people in the comments forget that typescript is not only giving you types features but whole lots of other features like enums, extended class functionality that reminds other OOP languages, attributes and so on and on...

    • @handlechar568
      @handlechar568 ปีที่แล้ว +3

      yeah but enums are an antipattern in TS. have fun trying to extend/implement/compose enums. Not that you can do that in many languages, but if you simply use string literal unions instead, you get all the benefits of enums and all the extra power of normal TS types.

    • @armandasbarkauskas4485
      @armandasbarkauskas4485 ปีที่แล้ว

      @@handlechar568 I agree on this one. As a TS developer you have flexibility to choose 💪

    • @armandasbarkauskas4485
      @armandasbarkauskas4485 ปีที่แล้ว +1

      @@highiqandrational Thats an idea out of the blue with 0 arguments to support it. OOP helps to solve a lot of fundamental problems. Its reliable, secure (access modifiers in compiled languages), reusable. Pros list can go a long way...

    • @armandasbarkauskas4485
      @armandasbarkauskas4485 ปีที่แล้ว

      @@highiqandrational
      Your
      Reasoning
      Is
      Garbage

  • @justinian.erdmier
    @justinian.erdmier ปีที่แล้ว +1

    The simplest and most productive solution would be to leave JS altogether and move to a more sophisticated language like C#.

  • @hstrinzel
    @hstrinzel 6 หลายเดือนก่อน +5

    I ALWAYS thought Typescript was a useless invention. My thinking was "It comes from Microsoft and seemed to be some new way to make people unnecessarily dependent on yet another invention from them." Most of my apps have 30-50 lines MAX in Javascript, and even that is too much already. Typescript is DEFINITELY NOT NEEDED for that. I'm just not that TYPE.

  • @Eliasdbr
    @Eliasdbr ปีที่แล้ว +11

    Awesome name "type gymnastics", didn't think too much about it. But now that you mention it, I spend more time than I'd like to admit just trying to figure out what kind of type I have to write in order to make the red squiggly line to go away.
    That being said, I still love Typescript and I feel naked when trying to code with vanilla js

  • @deadlyecho
    @deadlyecho ปีที่แล้ว +6

    Look who's back, it's AI Jeff ❤

  • @starlederer
    @starlederer ปีที่แล้ว +4

    As far as i understood, Svelte is still using typescript but inside d.ts files and JSDoc comments. All they changes is the syntax not the toolset

    • @m4rch3n1ng
      @m4rch3n1ng ปีที่แล้ว +1

      ​@@gregor3099the svelte team very explicitly does not care about "code pollution" or whatever, jsdoc comments are a lot more verbose than regular typescript type annotations.
      but as a library, not an app, they care about productivity and one thing you can do in javascript is just open the node_modules/ folder and edit a file there. and if you use a package manager like pnpm (maybe regular npm works for that too i don't actually know) for local development, you can link your dependencies to local directories and any change you do in the node_modules/ folder is directly reflected in the actual repository, and at no point do you have to have tsc --watch command or something running in the background.
      also if you only have type checks on commits instead of literally any change ever you can quickly test something that would error normally (due to not-yet-defined types or whatever) but doesn't matter because it doesn't have to compile to run

  • @PutlerXLO
    @PutlerXLO ปีที่แล้ว +5

    That's true. The most optimal development performance and quality are achieved when using JS + .d.ts + JSDOC. This is especially true for projects that do not have a clear roadmap and requirements change frequently, which is common in agile teams. There is no need to type absolutely everything, but only public interfaces, and this can be done not immediately, but after you are sure that the implementation will end up in the final product. Typing in JS should be considered purely as documentation and not as a strongly typed programming language.
    As documentation, the .d.ts file is just wonderful. You don't need to search the source code for exports and declarations or run the IDE to understand what's in the modules. You don't need to filter types in your head when you're looking at the logic of your code, which often takes up more space than the code itself.
    I think the ideal thing for JS would be optional typing built around decorators. This way types could be checked statically by a linter in the IDE, and validated at runtime using the same type meta data.

  • @skewty
    @skewty ปีที่แล้ว +1

    Svelte, Drizzle & Turbo are insignificant compared to React, Angular and Vue. Look at market share. A bucket of sand on a beach does not determine the beaches landscape.

  • @Dontcaredidntask-q9m
    @Dontcaredidntask-q9m ปีที่แล้ว +10

    Theres a huge difference between library code and application code.. the benefits of js are more important for library code

    • @blalmal10a
      @blalmal10a ปีที่แล้ว

      so true

    • @springmemory6637
      @springmemory6637 ปีที่แล้ว +1

      Yep, can't imagine jsdoc being practical for a big project.

    • @kevinclark1783
      @kevinclark1783 ปีที่แล้ว

      Yep, a library I feel is a write implementation once sort of thing, ie you can’t refactor constantly without worrying about breaking changes, so you need to write a new version or a new method or class to extend functionality. So JSDoc is probably acceptable vs an application where it’s just faster to write and export types.

  • @goatofdeath
    @goatofdeath ปีที่แล้ว +4

    Didn't know about the jsdoc standard for doing types and I can see why someone would move to it. I love Typescript and am sticking with it. I don't see the compile step as being that laborious personally. I spend way more time thinking through coding problems that waiting on compilers. But to each their own, if a project wants to remove the compile step while keeping most of the goodness of Typescipt I can see that.

  • @draakisback
    @draakisback ปีที่แล้ว +11

    My biggest issue with all of this, is that some of these projects are just dropping all type systems entirely. JS is extremely hard to use if you don't have types to reference because the LSP doesn't really expose the APIs. So rather than looking up definitions of the API functions/objects you have to either go to docs or read the code directly. Its clunky for a modern library/project. Drop TypeScript, but implement some kind of type system like jsdocs to make it so that people can easily use your APIs without having to leave their text editors. I don't especially like typescript but the turbo 8 decision is especially stupid.

  • @NFSHeld
    @NFSHeld ปีที่แล้ว +2

    How would adding type annotations to native JS solve the type gymnastics problem? Wouldn't that just mean you have to do the same gymnastics, but now in native JS?

    • @lememz
      @lememz 3 หลายเดือนก่อน

      it's two different reasons from two different teams

  • @ayumuaikawa
    @ayumuaikawa ปีที่แล้ว +3

    I was using JS doc way before being forced to use TS at work, tbh yeah I can understand that type gymnastic thing, I do see the point of TS, I doubt it'll die, but I'll be leaning more toward native JS for personal projects, and keep using TS because my work require it and only for that reason

  • @Pesthuf
    @Pesthuf ปีที่แล้ว +15

    JSDoc just isn't nearly as powerful as TypeScript's type system.
    I can never go back. I'd rather write type ceremony code that is more complex than my actual code than deal with the uncertainty you get when not using TypeScript.

  • @onhazrat
    @onhazrat ปีที่แล้ว +3

    🎯 Key Takeaways for quick navigation:
    00:15 📜 TypeScript's adoption journey: TypeScript initially faced resistance but gained popularity, especially with Angular 2, and became widely used in the early 2020s.
    01:41 🧩 Reasons for ditching TypeScript: Some open-source projects like Turbo are moving away from TypeScript due to concerns about code pollution with "type gymnastics."
    02:37 🏗️ Using JS doc for type inference: SvelteKit is transitioning to plain JavaScript but still benefits from type inference using JS doc, which generates types and provides IntelliSense in editors.
    03:18 🤔 Future prospects: There's an ECMAScript proposal for optional type annotations in JavaScript, which could reduce TypeScript's relevance in the future, but TypeScript remains integral for some frameworks like SvelteKit and Next.js.
    Made with HARPA AI

  • @dapper-alien
    @dapper-alien ปีที่แล้ว +17

    i always felt scripting languages should be strict enough that your code runs, but loose enough to use in a repl or console for R&D and fast prototryping. JS and Python are so fun for that reason. I think TS had its place for development teams with green programmers or projects that plan on a long shelf life, but if i can replace it with jsdoc id rather do that then have a whole new language people have to learn.

    • @Äpple-pie-5k
      @Äpple-pie-5k 6 หลายเดือนก่อน

      best comment here, and sadly ignored by everyone

  • @scottamolinari
    @scottamolinari ปีที่แล้ว +1

    With SWC, the "slowness" of compilation is taken out of the equation. I'm talking about real gains in speed. Leave "100% type correctness" to the IDE and a CI build or maybe even a GIT hook, and you have great DX for TypeScript.

  • @jourdanfarmer
    @jourdanfarmer 8 หลายเดือนก่อน

    Dude, that stock footage of the guy beating up the laptop @1:30 is hilarious

  • @da-ker
    @da-ker ปีที่แล้ว +53

    I personally think it is time for JS itself to move forward. Things like optional types, better class support, loaders, annotations etc. should be added to vanilla. I overall really love to work with JS, but the basic feature-set is not up to date. Mixing TS features into JS would be out of my dreams. But at the pace that JS is evolving this may sadly take a decade at least.

    • @Toleich
      @Toleich ปีที่แล้ว +6

      JS evolving slowly is a feature.

    • @da-ker
      @da-ker ปีที่แล้ว +6

      @@Toleich Only for slow people.

    • @htspencer9084
      @htspencer9084 ปีที่แล้ว

      Js was shite on arrival, how it grew to become the defacto language is... Depressing.

    • @gruntaxeman3740
      @gruntaxeman3740 11 หลายเดือนก่อน

      @@htspencer9084
      It is like we got ass language like english to "lingua franca". Started from island where we got some latin, anglo saxon, old norse and gaelic mixed.

    • @htspencer9084
      @htspencer9084 11 หลายเดือนก่อน

      @@gruntaxeman3740 as a native English speaker: agreed! English is scuffed AF.

  • @marcinburzynski8082
    @marcinburzynski8082 ปีที่แล้ว +19

    It's not going to make TS obsolete because this ecma proposal introduces only syntax for adding types, but js engine will treat it as a comment. You'll still need TS for type checking

    • @devluz
      @devluz ปีที่แล้ว

      Which is a great combination. The type checking can then run in parallel while you develop and you don't have to wait for the latest compile to finish before testing.

  • @victorpinasarnault9135
    @victorpinasarnault9135 ปีที่แล้ว +80

    We just need to ditch JavaScript now

    • @donmba
      @donmba ปีที่แล้ว +4

      😂

    • @daedaluxs
      @daedaluxs ปีที่แล้ว +4

      maybe in an alternate universe

    • @okie9025
      @okie9025 ปีที่แล้ว +1

      what's the alternative? (if you say rust or go you're stupid)

    • @amorto3420
      @amorto3420 ปีที่แล้ว +2

      Honestly, I can ditch JavaScript but can't even think about ditching typescript. (For now) 😂

    • @edgardcz
      @edgardcz ปีที่แล้ว

      Please!

  • @ramonmaximiliano3557
    @ramonmaximiliano3557 ปีที่แล้ว +1

    Nowadays most average projects will use very often React, and that with typescript is a pain in the ass, very often people use the "any" type card to avoid errors, then I ask, why the f.. use typescript then?

  • @SnakeCaseGuy
    @SnakeCaseGuy 9 หลายเดือนก่อน +2

    I love this. The world is kinda hell bent on making softwares slower than ever.

  • @andreas3858a
    @andreas3858a ปีที่แล้ว +48

    People who hate strong typing never do debugging, especially on the big and complex project. It's true that is easier and faster to code without any strong typing, but it will take its toll when it's time to debug.

    • @Azurryu
      @Azurryu ปีที่แล้ว +4

      I have to refactor a huge PHP project with no type hinting, no interfaces and just passing random variables of any type around in multiple 1000+ line function collections. Arrays with unpredictable random keys that are only set somewhere in dozens of different functions that pass it around to each other makes it impossible to know what you have. God, I can't even rely on it actually being an array, I might suddenly get an object or a string back... that made me start also using JSDoc to its extreme inside our vanilla JS when there's no build step possible. All I really need added in JavaScript is strong typing, because nobody adding any way to track types anywhere is the primary cause of all our projects disasters.

  • @prashank
    @prashank ปีที่แล้ว +7

    I have used modern static typed languages but none feel so heavy handed as typescript, there’s always multiple ways of doing everything and sometimes it does feel like half the code is just satisfying the compiler. Maybe native JS types will be simpler.

  • @ryandsouza2962
    @ryandsouza2962 ปีที่แล้ว +7

    Svelte still uses TypeScript in the form of JSDoc so TypeScript isn't being ditched at all. `tsserver` still typechecks your code in the background as JSDoc just excludes the compile step.

    • @everythingisfine9988
      @everythingisfine9988 ปีที่แล้ว +2

      TypeScript is totally being ditched. But the process of type checking isn't 🪄

    • @elpolodiablo5486
      @elpolodiablo5486 ปีที่แล้ว

      ​@@everythingisfine9988 Just because a few libraries decided not to use TS doesn't mean it will be ditched.

    • @ryandsouza2962
      @ryandsouza2962 ปีที่แล้ว

      @@everythingisfine9988 That's the thing, TypeScript isn't just restricted to TS files and inline types, it's also the typechecker that checks your JS files with JSDoc, so that also counts. Removing TypeScript would also be removing everything like tsconfig and @types libraries which Svelte hasn't done.

    • @everythingisfine9988
      @everythingisfine9988 ปีที่แล้ว

      Guess I need to clarify. The monopoly of people using TypeScript for type checking is going away (beginning). A bit like how lodash has fallen away thanks to ES5. There are viable alternatives such as JSdocs that can reduce some pain points (always was an alternative, but lost in the hype of TS). But we also have ECMA script looking into supporting types natively. TS did a great thing introducing the FE to type checking. But if it can be integrated natively, and reduce tooling (potential pain points), why not?

    • @winns.x
      @winns.x ปีที่แล้ว

      Typechecks with less headache and more readable code. win-win

  • @spacewizards9039
    @spacewizards9039 11 หลายเดือนก่อน +1

    "Type gymnastics" is definitely how I would describe a large portion of my experience with TypeScript. For example, I'll never forgot the horror of integrating Leaflet into my Angular app while circumventing all of TS's dubious requirements.

  • @Feeds_
    @Feeds_ ปีที่แล้ว +1

    Good, I never bothered to learn it originally, I was just waiting for this exact moment where people stopped using it 😂

  • @geekwithdasause
    @geekwithdasause ปีที่แล้ว +10

    Can't believe how fast I clicked this video notification 😂

  • @maherf768
    @maherf768 ปีที่แล้ว +3

    I'm a firm believer in freedom, but I think modern workflow adds too many layers of abstractions.
    I do like controlling my code, but for many projects the setup and maintenance take more effort than the core code itself.
    never liked TypeScript or seen a need to use it, so I am glad to see big names make it clear again that not all of us NEED to use TS

  • @shateq
    @shateq ปีที่แล้ว +5

    (types):
    developers seeing new AUTO keyword in c++20:
    I don't love you anymore!

  • @Regalman
    @Regalman ปีที่แล้ว +1

    Typescript is a pain late at night when you are using new libraries and you get a boat load of typing errors. It is a annoying and draining. We just need something fast and quick to put in production so we can proceed to writing test.

  • @AnonVoids
    @AnonVoids ปีที่แล้ว +1

    What is funny to me is, when I see all the examples of type “gymnastics”, all I can see are people that don’t like to use TS, using TS.
    For example, why isn’t your “Subscribe” function referring to a named type, and or the callback? You’d be able to reference/reuse them and they’d also improve readability.
    Also for recurring types like EmptyFunction you can create it once and reuse across the project.
    Turbo’s removal of TS was a sole individual affecting the entire community, which was against and he knew it, simply because he didn’t like it.

  • @luc_b_
    @luc_b_ ปีที่แล้ว +6

    Interesting to see how JavaScript evolves similarly to Python who did introduce optional typing (most of it in 3.4 if I'm not mistaken)

  • @ibrahimkoz1983
    @ibrahimkoz1983 ปีที่แล้ว +8

    If you code complex domains, still Typescript is the king. Literal types are the key to achieve parse don't validate principle. Also, types are great for applying always domain model.

  • @silakanveli
    @silakanveli ปีที่แล้ว +8

    Typescript is productivity killer

    • @edsanville
      @edsanville 11 หลายเดือนก่อน +1

      I've found the exact opposite.

    • @joelnaya5341
      @joelnaya5341 5 หลายเดือนก่อน +2

      I'd like to see you debug a million lines long javascript project. when you can't understand what type a particular variable is until you skip to the part where the variable is used/put some data into, you'll know the pain.
      Static typing is also why C/C++/Java can be used for humongous projects and still are fairly debuggable and understandable by reading

  • @rchin75
    @rchin75 7 หลายเดือนก่อน +1

    Yes finally! TS is just an excuse to avoid properly documenting your code with JSDoc.

  • @ra2enjoyer708
    @ra2enjoyer708 ปีที่แล้ว

    More context to the video:
    - JSDoc syntax is not something formalised in an RFC or something like that. That means it's only as good as the libraries which implement it. And the biggest implementation which is still alive to this day is... Typescript. So the projects which claim to "drop" typescript merely make it an indirect dependency and, considering the nightmare ESM brought into typescript configurations, will have to debug type issues, caused by different major Typescript version consumers, anyway.
    - Type gymnastics is a direct result of code complexity. Ironically the example in the video is quite on point, because you can look at signature and already see a bunch of void-returning functions, aka the logic revolves around purely side effects, which are always a complete clusterfuck to manage. This is not something you can pick up on easily by looking at vanilla js code.

  • @RustyNova
    @RustyNova ปีที่แล้ว +4

    I feel like the main reason they want to ditch TS is because by trying to fix JS, it made it worse.
    Perhaps it would be better to focus more on Webassembly instead of keeping JS

    • @BuyMyBeard
      @BuyMyBeard ปีที่แล้ว

      I don’t think they made it worse when you look at how people perceive Typescript in the Stackoverflow surveys

    • @RustyNova
      @RustyNova ปีที่แล้ว

      @@BuyMyBeard I mean worse on some points, like the compilation step, messing around with types, etc...
      I'm still on team typescript, but more and more I think we should ditch it for more stable programing languages. Typescript is a band-aid on a severed limb. It"s better than nothing, but we could go straight to a protesis instead.
      Now webassembly can be compiled from nearly any languages, including javascript and typescript, and it also improve stability and compile time error checking instead of runtime errors

    • @BuyMyBeard
      @BuyMyBeard ปีที่แล้ว

      @@RustyNova to be fair it really is the best case scenario if javascript becomes typescript honestly. Javascript needs to stay a simple and easy dynamically typed language, but also support static types and detect problems with those. The thing is I don't think that will ever happen, so Typescript will probably be there to stay

  • @adambeck6070
    @adambeck6070 11 หลายเดือนก่อน +5

    I always just saw Typescript as a huge obstacle. It really just slows down development for me. If you write good enough tests while developing and keep things neat and simple, vanilla js is great.

    • @karelevzen
      @karelevzen 11 หลายเดือนก่อน

      I always just saw writing tests as a huge obstacle. It really just slows down development for me. If you write good enough code and use type safety of TypeScript, life is great.

    • @adambeck6070
      @adambeck6070 11 หลายเดือนก่อน

      Someone's never worked on an enterprise project

    • @hydraorc1
      @hydraorc1 10 หลายเดือนก่อน

      Agree. I use a system approach that I call BETLL. It's babel + eslint + testing + logging + lodash. And you have a perfectly stable, performant and maintainable app with pure JavaScript!

  • @atari1040
    @atari1040 ปีที่แล้ว +3

    I keep talking about it since years that typescript should end up on version 1.2 maybe 1.3. But later they have added too much crazy stuff that is just polluting the code. It seems those code gymnastics are being used by devs who want to show off how smart thet are but that is not what I require from my team. I want them to write simple to understand code and not the one that requires phd degree. So I am happy ppl are coming back to JS as I think it has enough tools to become 1st class language for web.
    PS: I am wondering why the father of Pascal/c#/typescript agreed to make TS such a complex garbage in the end. It seems they have incorporated every possible technique from any language which doesn't make sense as it is too much but also other languages are made for other purposes so why would you mix all of that? doesn't make sense at all...

  • @leandrogoethals6599
    @leandrogoethals6599 7 หลายเดือนก่อน +1

    Python/C guy here i started react/TS 1 month ago, and i must say i have never seen such nasty unreadable coding.
    And i was also convinced python venv was the worst, well npm just passed that without a sweat. Oh npm says some vurnability and it suggest do npm audit ==> nah imma give a stupid certificate error and make sure nothing is compatible anymore.
    Oh what's that u wanna port a project? good luck with the package.json and it's lock that are to lazy to register the files.
    It has been hell just to make a mindmap out of markdown from a company structure, pure pain

  • @haramrit09k
    @haramrit09k ปีที่แล้ว +1

    Where do you get your videos, gifs and memes from? Is there a specific website you use?

  • @curlyfryactual
    @curlyfryactual ปีที่แล้ว +12

    Sometimes, I think my life as a C++ programmer is just a never ending dumpster fire.
    But then I look at the JS world and get a good laugh.
    Yes, C++ is still a never ending dumpster fire, but it's nice to know that JS is, too. Plus, watching the JS world trek through roughly equivalent mistakes to all those C++ has made in the past gives me nostalgia.

  • @stephenpaul7499
    @stephenpaul7499 ปีที่แล้ว +4

    You don't really need types if you are working on code that needs a ton of unit tests (like a library). You do need types when unit tests are too costly to write and maintain. Libraries still need to expose types though.

    • @shurmario
      @shurmario ปีที่แล้ว +1

      This comment does not make any sense.

    • @stephenpaul7499
      @stephenpaul7499 ปีที่แล้ว

      @@shurmario unit tests are too costly to maintain when working on a relatively straightforward crud app. Ive worked in many startups where unit tests do nothing but add complexity to a project code base without providing much protection. Furthermore they often get in the way of refactoring as requirements change. If you work at a bank, then perhaps unit test are warranted because of a large budget, a high cost of failure and a relatively low likelihood of change. When working on CRUD projects, types provide a degree of safety without imposing too much cost and allow quick pivots as requirements change.
      When writing a lib, extreme quality is more important and therefor warrants thorough unit testing. You can use internal types but, often, they get in the way and don't add much value. They are not an adequate substitution for unit tests.
      The point of my comment is to use the right tool for the right job. I reject the commonly held view that unit tests always provide the best protection in all circumstances without imposing any costs. Similarly types do not always provide adequate insurance against bugs. There are very few hard rules in software, only tradeoffs.
      I hope I am making more sense? Let me know if you are unsatisfied by my explanation as I want to learn from you too. Perhaps you have something to teach me 🙂

    • @elmehdichoukri5378
      @elmehdichoukri5378 9 หลายเดือนก่อน

      ​@@shurmarioyou replying like this is even more trded

  • @wiskasIO
    @wiskasIO 9 หลายเดือนก่อน +13

    The problem isn't JavaScript, the problem is you people using JS in the backend... It wasn't meant for that and it's so freaking obvious, if your code base is large enough you need a language that actually enforces types at compile time, we have use Java Spring Boot without hiccups for over a decade.

  • @supersecretninjame
    @supersecretninjame ปีที่แล้ว +1

    Is it worth it to learn typescripy now, then? I have managed to build aapps just fine without it so far.

  • @dechowdev
    @dechowdev ปีที่แล้ว +1

    Hey so DrizzleOrm does support TS they were just taking a dunk on the DHH post
    They elaborated that further in a subsequent tweet