Removing TypeScript - DHH | Prime Reacts

Sdílet
Vložit
  • čas přidán 7. 09. 2023
  • Recorded live on twitch, GET IN
    / theprimeagen
    Reviewed Tweet: dhh/status/169942...
    Article: world.hey.com/dhh/turbo-8-is-...
    Author: David Heinemeier Hansson (DHH) | / dhh
    MY MAIN YT CHANNEL: Has well edited engineering videos
    / theprimeagen
    Discord
    / discord
    Have something for me to read or react to?: / theprimeagenreact
    Hey I am sponsored by Turso, an edge database. I think they are pretty neet. Give them a try for free and if you want you can get a decent amount off (the free tier is the best (better than planetscale or any other))
    turso.tech/deeznuts
  • Věda a technologie

Komentáře • 596

  • @ericng8807
    @ericng8807 Před 8 měsíci +426

    I do respect when people stick to their guns and really evaluate what works for them and their workflow. But man, I'd lose my shit if autocomplete didn't work

    • @ThePrimeTimeagen
      @ThePrimeTimeagen  Před 8 měsíci +103

      lsp is very important tool

    • @WilsonSilva90
      @WilsonSilva90 Před 8 měsíci +14

      Turbo has a tiny public API. It won't make much difference.

    • @danvilela
      @danvilela Před 8 měsíci +18

      Even auto import stops working without it. It’s insanity.

    • @danielsharp2402
      @danielsharp2402 Před 8 měsíci +37

      @@WilsonSilva90 The sad reality is some hardworking soul is going to write the d.ts and add a @types repo instead of just letting it die with this decision.

    • @MelroyvandenBerg
      @MelroyvandenBerg Před 8 měsíci

      @@danielsharp2402 which is fine I guess.. But the base code is now still more readable.

  • @nen_02
    @nen_02 Před 8 měsíci +521

    When I just started programming, I love programming languages that support dynamic typing. But after coding big projects with them, I started hating them.

    • @jel1951
      @jel1951 Před 8 měsíci +46

      Dynamic programming is crap but I've always hated Typescript syntax. The ugly code you have to write just to get fake types!

    • @oscarljimenez5717
      @oscarljimenez5717 Před 8 měsíci +52

      ​​@@jel1951if you're writing ugly TS in apps, you're usually writing wrong. And yeah, you can write TS wrong, because of his due to its incremental nature.

    • @cowabunga2597
      @cowabunga2597 Před 8 měsíci

      ​@@jel1951static types you meab

    • @NECOdes
      @NECOdes Před 8 měsíci +14

      @@oscarljimenez5717 no, it's still ugly and never been amongst "good looking" ones

    • @ameer6168
      @ameer6168 Před 8 měsíci +44

      ​@@jel1951i don't care if it's ugly or mot atleast I'm not spending 5-6 hours to debug code for some silly mistakes

  • @sk-sm9sh
    @sk-sm9sh Před 8 měsíci +63

    I love packages like turbo, that when I go to their npm/turbo, they have all the most important sections like "Community", "Who Uses It", "Security", yet it doesn't have a single word to my boring question "What the heck is turbo?" Surely many people use it so I guess I guess I just gonna do "npm install turbo" regardless of what it does - that's just about the way these days people pick tools.

    • @homelessrobot
      @homelessrobot Před 8 měsíci +6

      if you go to the main page of their website, it tells you at the top of the page:
      > Turbo is an incremental bundler and build system optimized for JavaScript and TypeScript, written in Rust.
      ... though I had to click around for like 5 minutes to figure this out from the npm page.

    • @sk-sm9sh
      @sk-sm9sh Před 8 měsíci +1

      @@homelessrobot I know. But don't think you think it would be better if it was first chapter in npm package so that I can quickly decide weather or not I am interested and weagher or not spend more time to look for more information on the homepage ?

    • @homelessrobot
      @homelessrobot Před 8 měsíci +1

      @@sk-sm9sh yes, i do.

    • @ajfalo-fi3721
      @ajfalo-fi3721 Před 8 měsíci

      Hmmm guys, I think you're looking for the wrong turbo. That's vercel's turbo (which is ok I guess). This whole drama is about @hotwired/turbo

    • @thatssosanya
      @thatssosanya Před 8 měsíci +7

      ​@@homelessrobotwrong turbo. the topic of the video is hotwired turbo

  • @nordern1
    @nordern1 Před 8 měsíci +127

    I've checked the PR, they hardly use generics, much less any complex TS. Replacing TS with JS doc I can understand, but there has been nothing gained with this PR.
    Personally I'd rather not use APIs that can't even be bothered to declare what values they expect.

  • @Altrue
    @Altrue Před 8 měsíci +247

    DHH making huge contributions to the dev community by curing everyone's imposter syndrome with a single blog post.

  • @HrHaakon
    @HrHaakon Před 8 měsíci +84

    Strict typing isn't the opposite of dynamic typing.
    It's strict vs loose, and static vs dynamic.
    There are dynamically typed languages with strict typing, like Common Lisp. There are statically typed languages with quite loose typing, like C. Then there's loose/dynamic like JS and PHP, and strict static like Ada.
    What I've come to learn is I'm fine with dynamic typing, I'm fine with static typing, but I really hate loose typing.

    • @ElPikacupacabra
      @ElPikacupacabra Před 8 měsíci

      Then you have to define "dynamic typing". Do you mean runtime type inference?

    • @HrHaakon
      @HrHaakon Před 8 měsíci +2

      ​@@ElPikacupacabra
      Yes, probably, unless there's some gotcha you want to pull from some obscure 1974 paper or something...

    • @coolcax99
      @coolcax99 Před 8 měsíci +1

      This is the first time I have heard anyone describe C as loose typing. What do you mean? Every variable has to have a type with a fixed size. Are you referring to the C compiler automatically/user manually converting types in expressions?

    • @HrHaakon
      @HrHaakon Před 8 měsíci +9

      @@coolcax99 Every variable is fixed at compile time, so it is static.
      However, things like type punning means that it's not really enforced.
      This makes sense for C, of course, but it's an example of something that has a static system that is not particularly strict.

    • @raenastra
      @raenastra Před 8 měsíci +6

      I usually see it written as "strong" vs "weak" rather than "strict" and "loose". Strong, in this case, meaning resistant to coercion.
      Python is dynamic and strongly typed. Type checking happens at runtime, but you still can't use an int as a string; it'll raise an exception.
      JS is dynamic and weakly typed. Type checking also happen at runtime, but you can use an object as a string and it'll implicitly coerce the type for you.
      Not sure how C fits into this model. It's somewhere in the middle - it does implicitly coerce some things for you, but not as much as JS

  • @sameed1992
    @sameed1992 Před 8 měsíci +32

    the name is the prone-agen

  • @lazyh0rse
    @lazyh0rse Před 8 měsíci +30

    I guess, it's about choose your poison type of thing. For me, typescript solved the headache of having to test everything every time I change some code. Typescript kinda a pain to write, but once written you are almost sure your code is going to work. THAT's the difference.

  • @zactron1997
    @zactron1997 Před 8 měsíci +41

    Dynamic typing is great when you don't know what you're trying to write. That's not meant to be an insult, it really is when it's most useful. Being able to just write code and vaguely smash it together even when it doesn't fit is great for mucking around. But if you know what you're trying to solve, if you have any kind of path you can follow, then static typing immediately becomes the superior choice. I've played with dynamic languages (Python, JavaScript, etc.), and static ones (kinda TypeScript, C/#/++/Rust, etc.), and the stage of an idea makes a massive difference in what's more useful.
    That's why I think I enjoyed using Rust so much, since it gave me the niceties of NPM/eslint/etc. in an all-in-one with a very good type system (I know OCaml is meant to be better and I do intend on trying it eventually, but for now Rust is such a good fit for me I don't have a strong force pulling me away).
    Anyway, it's a dick move to make your library a binary blob and just say "idk, just use it right lol"

    • @homelessrobot
      @homelessrobot Před 8 měsíci +1

      I see things a little different. Well actually, almost 180 degrees opposite of how you have described things. I think dynamically typed languages are more appropriate when the path is well trodden. Specifically, when the largest sub-components of your thing already exist as stable external components, and the work you are doing is gluing things together or probing an interface boundary. So mainly things that don't actually have all that much nuance to their internal structure. If the structure is obvious, the structure is obvious.

    • @user-fr2fm3ri3w
      @user-fr2fm3ri3w Před 8 měsíci +1

      @@homelessrobot "I don't know what the word interface means therefore I don't need it"

    • @homelessrobot
      @homelessrobot Před 8 měsíci

      @@user-fr2fm3ri3w whether you need it or not though, its there, and you are going to interact with it unless your programs don't interact with other code or the user interface or the internet or anything. It's the I in API
      (also i didn't see the quotes, lol)

    • @user-fr2fm3ri3w
      @user-fr2fm3ri3w Před 8 měsíci +1

      @@homelessrobot saying strong types are bad for big projects is like saying being an alcoholic makes you a good dad. At some points you stop saying your subjective opinion and you start sounding silly.

    • @PatternShift
      @PatternShift Před 8 měsíci +1

      In a way, you're both right and both wrong. Dynamic typing is best when (1) you know what you're trying to do, and (2) you don't yet know what you're trying to do. So you know, almost all of the time. Static typing is definitely the best though when you need the code to go really fast and you need strong guarantees about its behavior. So basically, static typing is only good when you're using Rust. Otherwise it sucks. I mean think about it -- when you're using Rust, you get (1) fast code, (2) guarantees about memory safety (3) guarantees you won't fall into weird concurrency traps and (4) strong functional bounds on program behavior like you get from Haskell or OCaml. Every other statically typed language gives you 0-1 of those benefits.
      You guys realize there was a head-to-head study done recently and they found that javascript projects had a significantly lower defect rate than typescript projects? They were trying to prove the opposite, that it protects you from bugs, and literally got a 0.99 p value on the hypothesis test. That's pretty much the same as finding out you can be 99% confident that using TypeScript instead of JavaScript will produce more defects. 😂
      DHH is definitely a silly man-child though, I can't argue with that.

  • @jongeduard
    @jongeduard Před 8 měsíci +14

    ECMAScript itself should have had types to begin with, at least optional. That's still how I think about the whole thing. It should never have been needed to develop a second language. Having it built into a JS runtime not only saves you from the need of a transpiler, but also bennefits performance a LOT. This is the biggest mistake which has been made around it in history.
    In fact in the past, there have even been dialects of the language around which already supported types and classes far longer than a decade ago, but which have been discontinued.
    In fact this was one of the intended goals for ECMAScript 4, the version that never happened. And the most ironic thing, which not many people know either, is that it was for a large part due to Microsoft that it never succeded, because they did not want to agree with the idea of JS to evolve into a powerful technology, because they rather wanted to preserve their very crappy Internet Explorer in the horrible way that it was.
    It was that same Microsoft which later invented TypeScript instead. Is this really a coincidence?

    • @ra2enjoyer708
      @ra2enjoyer708 Před 8 měsíci

      Yeah people tend to forget that Javascript (especially the browser one) is crappy because it was born out of free-for-all fight between vendors with all dirty tricks in the world possible and has to accommodate all the legacy code written in those times. That's like python 3 having to be fully backwards compatible with python 2 and python 1 (even pre-GPL license) code.

    • @a-yon_n
      @a-yon_n Před 8 měsíci

      Regarding some latest changes in the ES, I’d prefer not having types in js, just do ts. No more messing up with ts please.

    • @Diosdaddy
      @Diosdaddy Před 21 hodinou

      I didn’t know that Microsoft was the company that rejected ES4! 😡. ES4 did happen but not in the browser, was used in the glory days of Adobe Flash (when it introduced bitmap manipulations, 3D and video, before html supoorted those things) under the name ActionScript 3 and was great and very sophisticated (even compared to today’s JS). I’m sure that the strict data typing was the thing that allowed it to optimize the instruction to do heavy graphics inside web pages with the hardware we had had in those days.

  • @stevenhe3462
    @stevenhe3462 Před 8 měsíci +64

    We knew DHH does not care about backwards-compatibility from the fact that each Rails version breaks the last one.

    • @lungfish
      @lungfish Před 7 měsíci

      People get rightly punished for relying too much on bad third party tools

  • @doresearchstopwhining
    @doresearchstopwhining Před 8 měsíci +123

    Can we get a primeagen vs DHH cage match? Seems like the only reasonable way to settle this dispute.

    • @Thect
      @Thect Před 8 měsíci +25

      DHH will be too busy solving errors in all of his wonderful, complex, and geniusly well put together apps.
      If only there's an easier way for him to find all these bugs faster, so we can have a Prime vs DHH fight...

    • @basione
      @basione Před 8 měsíci +10

      DHH will be too busy meeting women. He wouldn't expect us to understand.

    • @piyushgandhi7959
      @piyushgandhi7959 Před 8 měsíci +1

      DHH will be too busy racing

    • @piyushgandhi7959
      @piyushgandhi7959 Před 8 měsíci +1

      Racing to solve those undefined bugs XD

    • @OzzyTheGiant
      @OzzyTheGiant Před 8 měsíci

      Turbo 8 doomed to fail now. I didn't even know it existed before this discussion.

  • @Gornius
    @Gornius Před 8 měsíci +61

    I'm pretty sure some people forgot how obnoxious was coding, where you had parameters like "size", and then having to look up a documentation (or source code) on what the author means by "size".
    Self-documenting property of statically typed languages is in my opinion the most important aspect of them.

    • @ruanpingshan
      @ruanpingshan Před 8 měsíci +16

      My first time coming into contact with Python, I had to look up the source code of a function, then the source code of functions that it called, and then the documentation of functions that those functions called, just to find out the return type of the first function.
      It turned out to be something like list of lists of pairs of strings.

    • @nandoflorestan
      @nandoflorestan Před 8 měsíci +3

      And this is why every library and every large app written in Python must use mypy.

    • @sk-sm9sh
      @sk-sm9sh Před 8 měsíci +1

      @@ruanpingshan also same thing for passed arguments, and then some functions in some conditions would return entirely different structures.

    • @NihongoWakannai
      @NihongoWakannai Před 4 měsíci +1

      Oh god, using godot engine and having to look at documentation every time I want to get collision data because it's returned as a dictionary with string keys instead of a struct.

    • @Slink3322
      @Slink3322 Před 2 měsíci

      Because size:number is so much clearer?

  • @LoneDWispOfficial
    @LoneDWispOfficial Před 8 měsíci +6

    tbh, after months coding with Javascript, I felt more joy to code when I have learned JSDoc, because when you start to earn intellisense, programming quality increases a lot. And months after using JSDoc, I find more joy when start using typescript, because I was stop to getting errors generated by accessing a properties from a undefine data (many times easy to fix, but a often is something that you eyes just don't catch).
    What I have learn from that is: I don't want to block my code from compiling because of typing, but I really wanted the lint warnings/error highlight to let me spend more time programming an idea, instead debugging. For rules that I don't like in Typescript, I just disable then, so my lint don't force me to make nonsense workarounds.
    All this is the context of build small apps.

  • @martiananomaly
    @martiananomaly Před 8 měsíci +58

    I was hesitant to try Typescript for a long time. When I actually tried it, I could not go back to a javascript codebase because javascript truly sucks in comparison to typescript. Long live typescript.

    • @a-yon_n
      @a-yon_n Před 8 měsíci +5

      I still write js for some simple scripts, but even that I need to use jsdoc, without type hint and autocompletion, I don't know what I can do.

    • @loshan1212
      @loshan1212 Před 8 měsíci +5

      ^^ above comment is exemplar Stockholm syndrome cause by TS.

    • @UwU-dx5hu
      @UwU-dx5hu Před 8 měsíci +1

      Agreee typescript is really nice to be honest

    • @GameFuMaster
      @GameFuMaster Před 5 měsíci

      @@loshan1212 Typescript feels incomplete at times, and at worst, needs some typing gymnastics.
      Take for example, if you do Object.keys(obj), it'll just return string[], instead of the array of the keys.
      There are probably other outliers but these kind of cases makes me think that just using JSDoc to document the major expectations, and then just get used to the codebase, rather than spending half your time trying to type correctly, only to throw them out once specs change

    • @loshan1212
      @loshan1212 Před 5 měsíci

      @@GameFuMaster i think the original comment i replied to was deleted. my reply seems to make no sense.

  • @xbmarx
    @xbmarx Před 8 měsíci +31

    It's funny to me that simultaneously the worst example of dynamic typing is JS, and the worst example of "static" typing is TS.

    • @ThePrimeTimeagen
      @ThePrimeTimeagen  Před 8 měsíci +13

      super position of the worst

    • @smallfox8623
      @smallfox8623 Před 8 měsíci +3

      Typescript is statically typed end of. No quotes needed.

    • @nordern1
      @nordern1 Před 8 měsíci

      JS and TS aren't examples of worst anything. There are bullshit languages being used in the wild by companies that will make you beg for a language with a functioning debugger.

  • @Bytewalker
    @Bytewalker Před 8 měsíci +7

    the creator of Ruby on Rails doesn't like type safety, color me shocked.
    The spirit of javascript, just lmao - a shit language created in 7 days so netscape could put Java in the name

  • @biz0r07
    @biz0r07 Před 8 měsíci +44

    I'm sorry...I don't care that a couple of projects have stopped using it, I find it WAY TOO VALUABLE to drop TS

    • @blobglo
      @blobglo Před 8 měsíci +3

      based take

    • @justpatrick_
      @justpatrick_ Před 8 měsíci +1

      Yeah, besides it's libraries not products

    • @VuTuanIT
      @VuTuanIT Před 8 měsíci +1

      Like “I’m doing what I want, fuck all people who relates to my thing” 😂

  • @hellelo.5840
    @hellelo.5840 Před 8 měsíci +2

    The coupling between the type system and the code makes it easy to make root changes after a long time from touching codebase

  • @JohnSmall314
    @JohnSmall314 Před 7 měsíci +7

    Typescript is great if you're paid by the hour working in a big company with massive budgets and not much focus on getting product out.
    If you're doing a Rails project then you want rapid development, and Typescript is just going to hold you back.A five minute job can easily become 5 hours while you try to figure out what TS is complaining about. It's also a big cause of bike shedding, because it gives people encouragement to obsess over minute differences in coding styles.

  • @jdiehl2236
    @jdiehl2236 Před 8 měsíci +3

    "We're getting rid of TypeScript because I'm not having as much fun as I would have without it. All technical reasons aside, I'm the boss and I don't enjoy writing it so byebye!"

  • @thegrumpydeveloper
    @thegrumpydeveloper Před 8 měsíci +3

    Me coding in js after coding in ts feels like running around with scissors on a floor full of nails and then onto a high wire rope without a net. Fun times.

  • @FeLiNe418
    @FeLiNe418 Před 8 měsíci +128

    Even The Primeagen is Prone to mistakes

    • @siveroo7493
      @siveroo7493 Před 8 měsíci +14

      The Proneagen

    • @uqams
      @uqams Před 8 měsíci +5

      Proneagen Toagen Mistakesagen

  • @hermestrismegistus9142
    @hermestrismegistus9142 Před 8 měsíci +115

    DHH saying that Javascript is his second favorite programming language throws up major red flags. This guy is nuts.

    • @nitsujism
      @nitsujism Před 8 měsíci +14

      Well, his first is Ruby so there's that (although personally I quite like it).

    • @modicool
      @modicool Před 8 měsíci +1

      How's that? Do you mean instead of Typescript? If you're only dealing with web stack, it's useful to keep certain things the same (like, say, using the same typedefs files referenced in both the server and client rather than duplicate them). Besides C# and PHP I have not really worked with any other languages for server-side. Open to suggestions.

    • @TheSulross
      @TheSulross Před 8 měsíci +13

      JavaScript and Ruby lovers are not people to be taken seriously - on any subject matter

    • @masterflitzer
      @masterflitzer Před 8 měsíci +7

      ​@@modicooldude if ruby and js are your fav langs you are insane, they're both just spaghetti langs not suitable for serious stuff, obviously you can code serious stuff in it but it's not suitable (there's a big difference)

    • @modicool
      @modicool Před 8 měsíci +1

      @@masterflitzer I don't use Ruby. I don't like Vanilla JS, I like Typescript.

  • @mattmmilli8287
    @mattmmilli8287 Před 3 měsíci +1

    Everyone grows up and realizes TS is more work up front but way less headaches ( for others as well ) in the future. Eventually anyways

  • @xaviernogueira
    @xaviernogueira Před 8 měsíci +5

    I like how python >3.10 does it. There is a "typing" library that allows you to typehint everything. There are ways to assert type at runtime, however its optional. In most cases one just satisfies a linter. Yes, its not as good as static typing, but I appreciate the opt in nature of it.

    • @nandoflorestan
      @nandoflorestan Před 8 měsíci

      It is BETTER than static typing because you can write with static types most of the time and then at 1 or 2 places use dynamic typing for great effect. It's more powerful.
      But if you actually do that, you are wrong, and an idiot. Don't do that.
      Anyways, not sure why you and the youtuber have more trust in a compiler than in a type checker. Doesn't make sense to me, maybe I am missing something.

    • @simplygenius4847
      @simplygenius4847 Před 8 měsíci

      Exactly what i was just thinking... Js can use something like that

    • @user-fr2fm3ri3w
      @user-fr2fm3ri3w Před 8 měsíci +2

      @@nandoflorestan ahh yes lets check types at runtime as if python isn't barely faster than doing the math with pen and paper. What's next make every variable a global?

    • @PatternShift
      @PatternShift Před 8 měsíci

      @@nandoflorestan by what measure is it better than static typing? the fact that it's optional? you get none of the actual good things you get from a compiler enforcing types and you dirty up some simple python code with a bunch of verbose type hints, to get little more than spell checking out of a linter. you're better off without the type hints. python never would have blown up in popularity like it did if there were brainless type hints littered out everywhere in its early days like there are now.

  • @Stevie1derson
    @Stevie1derson Před 8 měsíci

    @7:47
    I know this is a vim based ch, and I'm in the boat of learning it the way prime did with an IDE first, BUT, hear me out... So regarding the snippets, most JetBrains IDEs now include Ai Assistant.
    I've been using the "Write documentation" pre defined prompt (if it's not there you can add it on your own manually) and this essentially asks the AI to read selected code, and write documentation. Based on the code it knows to write JSDoc, GoDoc, C#'s /// (w/e you call this crap) etc.
    This is big timesaver for me! Worth checking out

  • @Manker00
    @Manker00 Před 8 měsíci +6

    There should probably be a (black) background for the chat as currently neither the article text blow nor the chat above are readable; as such at least the chat is readable

  • @lauraprates8764
    @lauraprates8764 Před 8 měsíci +45

    The surprise isn't the drop on TS, but rather being proud of using JS

    • @ZephrymWOW
      @ZephrymWOW Před 8 měsíci

      He just says he likes developing in it lol, It can be a pretty soothing experience after working on a project that heavily uses OOP / strict typing. Until its not... The paycheck it gives you is pretty soothing too

  • @Supersonicboom7
    @Supersonicboom7 Před 8 měsíci +1

    I love dynamic typing however the more expetience I have with working with strict tyoes the less I feel that type overhead. Now I've really gotten into meta programming and code generation I feel like strict typing is the way to go. However I wish it was possible to disable types on parts of the code momentarily while prototyping. This can't be done in Kotlin but in a roundabout way can be done in typescript, hence why I am a fan of typescript.

  • @jeezusjr
    @jeezusjr Před 8 měsíci +5

    Prime on language lovability: Javascript: "*spits*" Ruby: "*dies laughing*"

    • @nandoflorestan
      @nandoflorestan Před 8 měsíci

      I tried to learn Ruby when it was hot. It felt like Perl. Lots and lots of syntax and punctuation. Lots of "end". I was super glad to abandon the idea and go back to the legibility of Python. I'll never understand DHH's love for the Ruby language.

    • @user-fr2fm3ri3w
      @user-fr2fm3ri3w Před 8 měsíci +4

      @@nandoflorestan "Legibility of python" dude each one of your comments gets worse I swear python devs come out of some cult or something.

  • @badalsaibo
    @badalsaibo Před 8 měsíci

    Man so it was your comment at the end of the PR. I laughed like hell when I read that. Absolutely hilarious 😂

  • @DavideFicano
    @DavideFicano Před 8 měsíci +14

    In my team there are smart and (I'm thinking to a non offensive term...) "less smart" developers, since we use TS (and eslint) we noticed a decrease of bugs, and more important less regressions, libraries like Svelte and Turbo are written by the best programmers of the world but real applications are written by junior developers, demotivated people and only few smart guys like me (ahah I'm the best of the worst) so a strong type language is vital, putting types on JSDoc is possible on libraries but it's hard to be sure my team mates do this

    • @merryn9000
      @merryn9000 Před 8 měsíci +1

      Honestly sounds like you either need to learn to respect your team or hire some new people. You really don't need to be all that smart to be good at most programming jobs

    • @merryn9000
      @merryn9000 Před 8 měsíci

      *just not dumb

  • @LiquidToast12
    @LiquidToast12 Před 8 měsíci +2

    Typescript is great for people who aren't smart enough to know how to work with dynamically typed languages.

  • @tychoides
    @tychoides Před 8 měsíci +1

    In my experience static typing shines when you have a big app or library with a clear design and you need to implement the logic carefully. Dynamic typing is great for scripting or data analysis. For the user. Most of the time the variable types are self explanatory in scripts and you don't really need the boilerplate code anyway. I am working in data science and scientific computing, and the true is that the main issue is not type bugs but issues with the data itself. Dynamic typing and interpreted languages with a REPL like loop are great for understanding the data fast. That is the reason I use Python since 2.5. as it is great in that and as glue language for faster code.

  • @johnpope1473
    @johnpope1473 Před 8 měsíci +1

    00:04:22 - I agree - but in the last week - I've started just throwing objects at chatgpt - and asking it to define the types. Eh voila`. takes pain away.

  • @Iggy_Lakic
    @Iggy_Lakic Před 8 měsíci +18

    Your closing PR message Primeagen is legendary, pure magic😀👍👍

  • @badunius_code
    @badunius_code Před 8 měsíci +3

    5:10 all strict type languages works like this. But if you enjoy not knowing what structure is expected as an argument or is returned from a function, who am I to stop you.

  • @fabricio5p
    @fabricio5p Před 8 měsíci +2

    The whole reasoning is literally: "It's hard, me doesn't like it"

  • @DanteMishima
    @DanteMishima Před 8 měsíci +3

    Allow people to make the choice. Absolutely agree. But the typescript gang don't do that to they? They want everything with types

  • @jackdavenport5011
    @jackdavenport5011 Před 7 měsíci +2

    Personally I've tried JSDoc and it is no replacement for Typescript. I was using it because I was making a template for a coding workshop that I was sending out to kids and I didn't want them to have to install Node and a bunch of stuff to get Typescript working, so I switched back to vanilla JS and just used JSDoc for typing. I instantly started making clumsy mistakes again because JSDoc doesn't highlight errors when the types don't match anymore. And also when I closed the project and came back to it in my IDE, it didn't load up all of the types for files I hadn't opened and I had to open each individual file for Vscode to index the types, so doing that on a huge project with hundreds of files would be a bigger pain in the *** than just using Typescript in the first place. I respect some people not wanting to use it, but I think the tradeoffs of not using Typescript aren't worth it.

  • @PieterWigboldus
    @PieterWigboldus Před 7 měsíci +1

    JSDoc is great, you can do the same type checks and typescript with eslint, and you have a better seperation of runtime code and helpful information for development (type hints)

  • @slebetman
    @slebetman Před 8 měsíci +6

    For a couple of my new projects I've started using jsdoc and it's actually nice. It's ugly inside the code but it's nice when you're using the code.

    • @OzzyTheGiant
      @OzzyTheGiant Před 8 měsíci +4

      I started doing this when I joined a React project with plain JS. The tech lead can't organize code for squat and it is a pain having to debug all his spaghetti code, so I started implementing types using JSDoc and definition files. Works like a charm!

    • @peterradziewicz4685
      @peterradziewicz4685 Před 8 měsíci

      Yea unless you and everyone on your team are 200 IQ there's just no reason not to put at least some basic jsdocs with how functions are intended to be used. Just laziness honestly. Vanilla js gets a bad name because people are lazy

  • @AllanSavolainen
    @AllanSavolainen Před 2 měsíci

    I think I finally understood the problem, library people seem to be using types incorrectly. You shouldn't have any complex types, just the basic ones like string, int, float, array. You don't need more as you, as a library, should in any case do some checking on any passed value, with types you just know that the input given is a string, now just go ahead and verify that it is a valid URL.

  • @Heater-v1.0.0
    @Heater-v1.0.0 Před 8 měsíci +40

    I love Rust for its full anal fussing over types, mutable references, lifetimes, etc. Keeps me on the straight and narrow.
    I love Javascript for it full on "I don't care about anything" approach. Lets me type and go. Works in the browser with no compilation, no builds system nonsense.
    All the other languages I know fall "on the spectrum" between the two extremes and have nothing much different to offer.
    In short I love Rust and JS because they are polar opposites.
    Am I weird?

    • @__ritesh
      @__ritesh Před 8 měsíci +4

      No you are not weird that's me too. I really like the type system of Go and Rust

    • @perigord6281
      @perigord6281 Před 8 měsíci +1

      The weirdly high overlap of Haskell and C developers would disagree

    • @Dan_1348
      @Dan_1348 Před 8 měsíci

      Yes

    • @OzzyTheGiant
      @OzzyTheGiant Před 8 měsíci +1

      No, I'm on a similar boat. I love Angular because it enforces a rigid but clean app architecture on you using proper OOP patterns. Meanwhile I love Svelte because it's extremely flexible by allowing you to write JS in its simplest form, which is easy to read and understand.
      React in the middle is just a mess.

    • @Heater-v1.0.0
      @Heater-v1.0.0 Před 8 měsíci

      @@Dan_1348 Thanks Dan. Good to see I'm not too normal.

  • @elitnoctua
    @elitnoctua Před 8 měsíci +5

    Isn’t javascript already strictly typed? Everything can only be one type… an Object.

  • @EgorDemeshko
    @EgorDemeshko Před 7 měsíci

    it such a blessing to be able to hear a clever people. a dream just to write some code for some big staff.

  • @LongJourneys
    @LongJourneys Před 6 měsíci +2

    I dropped TS in favor of JSDoc about a year ago and haven't looked back

  • @efferington
    @efferington Před 8 měsíci +2

    Was wondering if you would go with 'The name .. is theTypeagen', but theDHHagen works too :D

  • @jamesz80
    @jamesz80 Před 7 měsíci +1

    I love JavaScript but for a completely different reason to DHH, I.e without the classes, just keep it all functional.
    Functional code scales to infinite complexity, but you do need to know what you are doing. A couple of seniors to steer things in the right direction.

  • @redhawk3385
    @redhawk3385 Před 8 měsíci +2

    The popular library I'm using has a author like DHH, he's a nightmare to work with, and god forbid you need help.

    • @kevinclark1783
      @kevinclark1783 Před 8 měsíci

      Name shame it…also, why are you using it??

  • @JosephMcMurray1984
    @JosephMcMurray1984 Před 8 měsíci +3

    Typescript > JSDoc. I just don't see the benefits of using JSDoc over Typescript. Am I missing something?

  • @kabukitheater9046
    @kabukitheater9046 Před 8 měsíci +5

    i live for javascript drama. fuck, i love our community lol

    • @OzzyTheGiant
      @OzzyTheGiant Před 8 měsíci +1

      Ain't nobody got time for that! 😂

  • @peq42_
    @peq42_ Před 8 měsíci

    whats your view on javascript getting optional types, I believe?

  • @zheil9152
    @zheil9152 Před 8 měsíci +24

    Honestly, libraries dropping typescript and good docs shouldn’t be seen as brave. It’s just straight up hostile to other developers and a message that you don’t want your stuff used anymore. Should have changed the license while he was at it or permanently brought the repo/package down…

    • @ThePrimeTimeagen
      @ThePrimeTimeagen  Před 8 měsíci +19

      this is why i said its fine to drop it as long as you replace it. jsdoc is a perfectly viable replacement

    • @UGPepe
      @UGPepe Před 8 měsíci

      he must work for you then

    • @danvilela
      @danvilela Před 8 měsíci +2

      @@xodr5 brah, you clearly are a junior 💀 anyway you brought another topic. His move is making non experienced people say/do stupid shit

    • @zheil9152
      @zheil9152 Před 8 měsíci

      @@ThePrimeTimeagen brb going to make a PR to delete the implementation of every function so the module user has to figure that out too

  • @rkeenan85
    @rkeenan85 Před 8 měsíci +1

    That is God-tier trolling on that PR conversation.

    • @OzzyTheGiant
      @OzzyTheGiant Před 8 měsíci

      I freaking lost my marbles there 😂. Absolute Grade-A trolling. Imma go upvote that

  • @BudgieMind
    @BudgieMind Před 8 měsíci

    I subscribed but missing al the streams, when the streams are on air?

  • @renegadeace1735
    @renegadeace1735 Před 8 měsíci

    Hmm, yes there is the occasional typing gymnastics, but one of the things I like about TypeScript is when trying to using a library I know what props are the the thing is that I'm importing.

  • @snk-js
    @snk-js Před 8 měsíci

    these days I was trying to solve an algorithm problem with javascript in codewars and the problem was difficult so I pulled vscode code in it instead. Came out that I needed to switch to TS and after finishing converting again to js before submiting my code.

  • @ghun131
    @ghun131 Před 8 měsíci +2

    I dont like reading TS type but jsdoc is even harder for my eyes 😢. I wish JS optional static type proposal would come out soon

  • @bigbear187uk
    @bigbear187uk Před 8 měsíci

    How have I only found your content today 😂

  • @pharmajoe990
    @pharmajoe990 Před 8 měsíci

    In my experience dynamic languages are fast to build things with, but are awful to maintain at any reasonable scale. Types document code, enable much nicer refactoring and IDE tooling. I’ve used JS, TS, Ruby, Java, Groovy and Scala in big production apps and would always go for types over dynamic. But, whatever works, if it’s your project. Type compilation just saves so many bugs from making it into production code.

  • @br3nto
    @br3nto Před 8 měsíci +5

    2:20 Ruby is actually a very Awesome language. Makes you feel like God.

  • @kevinwood5048
    @kevinwood5048 Před 8 měsíci +2

    I can empathize with their decision from the viewpoint that Typescript adds overhead and complexity to your dev/build setup can add real maintenance cost. But as a consumable library, I hope they are not shooting themselves in the foot. At least use jsdoc where it counts.

  • @_evillevi
    @_evillevi Před 8 měsíci

    every day I fall even more in love with Rich Harris. damn you, BASED viking god!

  • @dylanmeeks54
    @dylanmeeks54 Před 8 měsíci +6

    Balls

  • @Its_Koala
    @Its_Koala Před 8 měsíci +1

    Holy shit that PR comment might be the funniest thing Prime has ever done.

  • @archmad
    @archmad Před 8 měsíci +1

    i love generics, but when im not doing it, only when im using it

  • @quelchx
    @quelchx Před 8 měsíci +4

    Sometimes I think the main argument I hear about typescript is basically it's too hard to define everything and people don't want to assign the ugly any type... so they go use JS where everything is basically any no matter what layer you add to 'define' things. To me it's any -- regardless of what comment is above it + you have to write a lot of damn comments. Makes sense I guess.

    • @squeezy9011
      @squeezy9011 Před 8 měsíci +2

      If TypeScript is too hard for somebody, they probably shouldn't be a developer.

    • @a-yon_n
      @a-yon_n Před 8 měsíci +1

      There are good developers and bad developers, some people just don’t care about code qualities, just keep away from them, and use generics.

    • @user-hu1jr6fb9k
      @user-hu1jr6fb9k Před 5 měsíci

      It is only hard to define everything, if you are working with very crap 3rd party code / libs or if you simply don't know what you're doing.

  • @MosiurRahman-dl5ts
    @MosiurRahman-dl5ts Před 8 měsíci +2

    Hey Prime, Bun released 1.0

  • @asdqwe4427
    @asdqwe4427 Před 8 měsíci +2

    I don’t get how js doc would be easier? How does it save you from complex types?

    • @kevinclark1783
      @kevinclark1783 Před 8 měsíci

      Ya all examples show simple function parameters and not object style that are just as much work

  • @gadgetboyplaysmc
    @gadgetboyplaysmc Před 8 měsíci

    Lmao that comment before Theo's PR was closed was gold man

  • @JustBCWi
    @JustBCWi Před 8 měsíci +4

    I thought DHH has not released this to prod yet. If the issue is typing, then perhaps he (or someone else) should consider adding JSDOCS and let's move on.

  • @Dave01Rhodes
    @Dave01Rhodes Před 8 měsíci +2

    It’s weird to me that ECMA haven’t put typescript-style hints into JS syntax. They could still be completely ignored at runtime, but your editor or source control integration step could validate types for you.
    And heck, JS already has “strict” mode. JS engines could add “strict type” mode where it does runtime type checking and throws type error exceptions.
    That and it would be funny to see a Microsoft product get embraced, turned into an extension to JS, and then extinguished.

    • @kon.simeonov
      @kon.simeonov Před 5 měsíci

      I'm doubtful this will ever happen, because type annotations will further bloat the bundle sizes and site load times.

    • @Dave01Rhodes
      @Dave01Rhodes Před 5 měsíci

      @@kon.simeonov true, but if you’re concerned about file size you’ll pass your production JS through a minifier and that can strip off type annotations.

    • @kon.simeonov
      @kon.simeonov Před 5 měsíci

      @@Dave01Rhodes What you're describing is the way the typescript toolchain works rn.

    • @Dave01Rhodes
      @Dave01Rhodes Před 5 měsíci

      @@kon.simeonov the point is that it wouldn’t have to work that way.

  • @Gorops
    @Gorops Před 8 měsíci +2

    We proly gona get types in vanilla JS sooner now.

  • @ismail-talb
    @ismail-talb Před 8 měsíci

    I just have a question : won't AI be able to type any js code in the coming few months?!

    • @guai9632
      @guai9632 Před 8 měsíci +1

      that's how humanity will end

  • @gadgetboyplaysmc
    @gadgetboyplaysmc Před 8 měsíci

    The video awaited since this was tweeted

  • @Icemourne_
    @Icemourne_ Před 8 měsíci +4

    I'm probably a weird outlier because I like TS's mental gymnastics. I also tried JS Docks a few times and hated

  • @MarkLitchfield
    @MarkLitchfield Před 5 měsíci

    Wait?!? Ruby is the preferred / recommended backend language? I've been doing it wrong all this time using Rust, Go and some Node. Where did my life go so wrong? Thank you DHH for rescuing me.

  • @wilhelmherzner3016
    @wilhelmherzner3016 Před 8 měsíci +8

    Douglas Crockford: Typescript solves a problem I don't have.

  • @cyberneticbutterfly8506
    @cyberneticbutterfly8506 Před 7 měsíci

    Whether I like Typescript or not is dependent on what the realities of my project at hand are.
    Size of project, library or application, timeframe and urgency, responsibilities I personally have on the project at hand, and so on.

  • @boldureans
    @boldureans Před 8 měsíci +1

    TypeKarens fight!

  • @Charles-pm4so
    @Charles-pm4so Před 8 měsíci +1

    If typing is the only thing one has understood of the benefits of Typescript, I'm tempted to believe one is a noob at TS and perhaps programming in general.

  • @djupstaten2328
    @djupstaten2328 Před 8 měsíci

    Just have interfaces and I'm happy. Apply them directly to objects or make classes, I don't care. Something needs to pop up when I type the "."

  • @Noble_Savage
    @Noble_Savage Před 8 měsíci +1

    Wait a minute, people still program in Ruby?

  • @sp3cterproductions
    @sp3cterproductions Před 8 měsíci +1

    This is what happens when the cocky fresh out of college junior never grows out of their self righteous phase.

  • @dromedda6810
    @dromedda6810 Před 8 měsíci +20

    DHH's favorite languages being ruby and javascript should've warned us way earlier about how nuts the guy is ... WE SHOULD'VE KNOWN

    • @_unknown_guy
      @_unknown_guy Před 4 měsíci

      @@michaeljb3107 yeah, laugh as much as you want, Rails inspired so many web frameworks and guess who the author is. Rails is opinionated and that is one of the reasons why it works - any developer joining project will be very familiar how things work no matter the size. Type people are ones that go nuts about library they wont even use or by the looks of comments here - does not even know what it does or are looking at the wrong things. The library has just a bunch of public methods, basically works on data attrs. And yet type apologists losing their nuts. Just another day on Internet.

  • @YoungGrizzly
    @YoungGrizzly Před 7 měsíci

    “hard things become ‘any’” bro that is so dam true!

  • @digitalspecter
    @digitalspecter Před 8 měsíci +1

    "Let me use this crappy type system to reinforce my rationalization why I like dynamic typing."

  • @UwU-dx5hu
    @UwU-dx5hu Před 8 měsíci

    This stuff is insane

  • @wiztek1197
    @wiztek1197 Před 8 měsíci

    The really funny thing for me is before this tweet is i never knew what turbo 8 is
    And days later i still don't know what it is

  • @kirglow4639
    @kirglow4639 Před 8 měsíci +1

    "Emotion-driven development"

  • @danteDeveloper
    @danteDeveloper Před 8 měsíci +1

    Is dieting on frontend tools are new trends in 2023 ?

  • @DigitalNomadOnFIRE
    @DigitalNomadOnFIRE Před 8 měsíci

    Implicit typing (eg in (C#) is the sweet spot IMHO.

  • @jppommet
    @jppommet Před 8 měsíci

    8:15 Lol the reaction, that’s a ruby 😅

  • @mrnotpewdiepie8957
    @mrnotpewdiepie8957 Před 8 měsíci

    I feel like it's inverse of the size of a project. Small project = nice to don't have to specify every type. Big project = understanding, refactoring and modifying code is so much better with strict types

  • @taylorkoepp3048
    @taylorkoepp3048 Před 8 měsíci

    You crack me up man

  • @krtirtho
    @krtirtho Před 8 měsíci

    Everything is the result of Typescript type loops/iterators, conditional types & template string type literals

  • @humansaremortal3803
    @humansaremortal3803 Před 8 měsíci +1

    Turbo is a thing under the hood, next to your engine.

  • @stevenhe3462
    @stevenhe3462 Před 8 měsíci +2

    Turbo, a part of HotGarbage.