CREATOR OF SVELTE From TS TO JSDoc??

Поделиться
HTML-код
  • Опубликовано: 3 дек 2024

Комментарии • 361

  • @AttilaButurla
    @AttilaButurla Год назад +231

    My biggest issues with TypeScript, aside from having a compilation step, is that some devs tend to go nuts with the TypeScript.

    • @me-low-key
      @me-low-key Год назад +50

      There are 2 types of devs and nothing in between
      type DevType = 'go nuts with the TypeScript' | 'any everywhere'

    • @baldcoder_
      @baldcoder_ Год назад +13

      Why is compilation an issue? And why did your issue with developers become an issue with the language?
      If I said my main issue with JSDocs is that most people half-ass them does that make the case against JSDocs?

    • @wota_pov
      @wota_pov Год назад +2

      @@baldcoder_ it takes more time to compile

    • @moodynoob
      @moodynoob Год назад +5

      I really debated on this issue. I love Ts and have no problem reading/writing complex types. However I know they're a pain to debug (to all devs) and read (for most devs).
      But for a project with crazy complex business rules, I made the call to write complex types (like 3 files worth of utility types to derive a type). I don't know if I made the right call for long term maintainability, but the DX it's unlocked given the tight deadlines and some of the large structural changes we needed to make due to last minute business requirements updates has so far made it worth it.

    • @jlebrech
      @jlebrech Год назад +3

      the java infection spreads to other languages

  • @collinslagat3458
    @collinslagat3458 Год назад +86

    We don't use TS where I work thus I heavily rely on JSDocs. Great to know there's a repo I can borrow ideas from. But given the choice, TS all the way.

  • @lajosviktor
    @lajosviktor Год назад +88

    The declarationMap: true ts compiler config generates maps for the d.ts files, so if you have an npm package with the dist folder, and the src folder, you can have direct mapping to the ts files for ctrl/cmd+click. (see RXJS)

    • @sortof3337
      @sortof3337 Год назад +13

      Email rich and save his time 🤣

    • @hamm8934
      @hamm8934 Год назад +11

      Rich seems like a great guy, but he’s said before that he’s only been a full time dev for 2 years. He’s obviously fantastic, but I really worry about his inexperience leading to rough design decisions.
      Wish him and the svelte team only the best, but I think his experience should be brought up more.

    • @Antonio-fo4fl
      @Antonio-fo4fl Год назад +16

      @@hamm8934 The guy created rollup....I think he has lots of experience lol

    • @hamm8934
      @hamm8934 Год назад +4

      @@Antonio-fo4fl in his last interview with Prime, he said he only became a full time dev 2 years ago. Prior, he coded on the side and worked for a news papers.
      Again, he’s obviously talented, but there are many lessons you only learn through experience.

    • @thekwoka4707
      @thekwoka4707 Год назад

      Yup.
      So much bad info out there on this. Even TSUP says you never need those.
      But the package should send the transpiled js, the source TS, source maps and declaration maps.
      Then all these tools work.
      But people are stupid as hell

  • @Zashxq
    @Zashxq Год назад +52

    from a library development perspective it makes perfect sense. im not sure if people will understand this nuance before making the switch to jsdoc though LOL

    • @ThePrimeTimeagen
      @ThePrimeTimeagen  Год назад +25

      agreed

    • @Antonio-fo4fl
      @Antonio-fo4fl Год назад +13

      @@Spidhey sveltekit has been using jsdoc for 2+ years now and it's more productive for them. I doubt they will miss ts files. They still use TS

    • @IStMl
      @IStMl Год назад

      @@Spidhey by then another framework will be trendy, we're good

  • @AlecMaly
    @AlecMaly Год назад +10

    Guy makes some good arguments. As a security focused individual, I do like the idea of cleaner code to audit; encouraging function descriptions may result in identifying logic issues, not just typing issues.

  • @marado_6702
    @marado_6702 Год назад +10

    Primeagen is my favorite Linux person

  • @Xe054
    @Xe054 Год назад +73

    The more I learn about Rich, the bigger the fan I become. He's just smart and pragmatic, so I'm just going to learn Svelte and know that my tech stack is in good hands.

    • @Xe054
      @Xe054 Год назад +10

      And in the meantime, I'm going to learn Rust and hope that it becomes widely adopted on the web. It sounds like Rust is just a better designed language instead of the bolted on mess we have in JS land.

    • @NiclasGleesborg
      @NiclasGleesborg Год назад +3

      I feel the opposite but hey, that's just me.

    • @Xe054
      @Xe054 Год назад

      @@NiclasGleesborg what's your favorite tech stack?

    • @nowayicommented1314
      @nowayicommented1314 Год назад +12

      Please god no rust in frontend. I’m all the way there to use it for the backend but don’t make the same mistake as JS and use a language for stuff it’s not made

    • @k-yo
      @k-yo Год назад +1

      ​@@nowayicommented1314 revenge time

  • @Dev-Siri
    @Dev-Siri Год назад +13

    things are going to shake up again once the types as comments proposal gets added to JS.

  • @real_ouss
    @real_ouss Год назад +5

    The reasoning sounds solid, but I really like TS as an extra layer for "classic" products, if you work in a non Netflix company (sorry for the shade) you will see how much issues it prevents, if you get strict with it, all the "of undefined" and "of null" issues, plus, it is a nice safeguard and doc when working with people having different levels. It is true though, that devs who don't have sufficient knowledge tend to spend a huge amount of time trying to fix types, but most of those are actual issues that would need solving anyway. Inferred types do a lot of heavy lifting too and I like them. Now what I don't like about TS is the false sense of security when dealing with REST api results per example, or when people use any or as unknown as T. But, overall in product teams, I find it really benificial.

  • @yeahaddigirl
    @yeahaddigirl Год назад +8

    The solution seems to be compiling to js + jsdoc instead of d.ts, or native TS support in browsers/node

    • @NatoBoram
      @NatoBoram Год назад +1

      Microsoft intentionally doesn't do that to make JS incompatible with TS so that people are forced to use TS. It's called "extend".

    • @2dstencil847
      @2dstencil847 6 месяцев назад

      @@NatoBoram No sure. As i know Chrome which is under another company still own more user share of browser....

  • @georgespanos4680
    @georgespanos4680 Год назад +28

    Rich's argument is the reason why I use Deno exclusively for the last 5-6 months for my personal projects. When you go to definitions Deno actually shows you the typescript code that's running. No bs .d.ts . Still today I have not found a solid reason not to go with Deno when doing TS/JS work.

    • @azufendusgarendum6583
      @azufendusgarendum6583 Год назад +2

      I went looking for this comment immediately after hearing Rich's first reason

    • @ac130kz
      @ac130kz Год назад +3

      if only Deno was completely compatible with all the npm and Node stuff, and didn't have some questionable decisions, like package urls in code

    • @vikingthedude
      @vikingthedude Год назад

      Deno doesn’t allow imports without the .ts extension. So it’s not possible to simply drop in an existing ts project into deno. But for scripts and new projects I definitely enjoy using deno

    • @georgespanos4680
      @georgespanos4680 Год назад

      @@vikingthedude existing projects it tough yea. After all it's a runtime. Not a framework.

    • @thekwoka4707
      @thekwoka4707 Год назад +3

      The d.ts issue is from many libraries not providing declaration maps and the source code. If they did VScode would handle it with no issues directly to the source.

  • @yungifez
    @yungifez Год назад +6

    Me as a laravel developer always hopping into vendor code

    • @Leonhart_93
      @Leonhart_93 6 месяцев назад

      Yeah, that is invaluable, I always end up stealing stuff.

  • @peopledrivemecrazy
    @peopledrivemecrazy Год назад +6

    Thanks for the bluesky link.

  • @jon1867
    @jon1867 Год назад +40

    This sounds like some solid reasoning on why to use JSDoc for library code. Never really thought about it this way.

    • @ThePrimeTimeagen
      @ThePrimeTimeagen  Год назад +10

      makes me want to try it, at least once

    • @sebsplatter914
      @sebsplatter914 Год назад

      Yeah same, was ready to disagree and dudes actually making good points I didnt consider. I mean not surprising the guy is a 1000 times better at programming than me, but still

  • @TankorSmash
    @TankorSmash Год назад +3

    Thanks for the bluesky link, it must have been tough to find.

  • @superalex4real
    @superalex4real Год назад +1

    The biggest reason for people needing to go to source is mainly not to change stuff, but to figure out what the hack is going on because very rarely anything is documented properly.

  • @vslow4795
    @vslow4795 Год назад +1

    His Blue Sky account is amazing. Thanks for the link!

  • @baka_baca
    @baka_baca Год назад +2

    I love the callout about "Typescript wizards"!
    So much of what I've seen from RUclips's Typescript wizard seem to suggest we should actually use a bunch of rather complicated types filled with tons of logic which honestly no one can read without really sitting down and thinking about it for a while. That nonsense helps no one, types are there to help write and read code correctly and ideally save some time but all that goes away if I'm writing and reading types endlessly instead of writing more meaningful code. Keep types but keep them as simple and straightforward as possible, no need to keep them DRY if it's gonna cause headaches!

    • @shableep
      @shableep Год назад

      those complex types are often for incredible autocomplete. you build in the logic of your function into the type, so if something complicated is happening to the values you send into a function, the full structure of data you should expect at runtime comes through. and if you use the function outside what is intended, it immediately tells you in your IDE.
      the type is there to tell your IDE if what you’re doing with the code is expected. luckily, GPT-4 is incredible at creating and describing types.

  • @m47h4r
    @m47h4r Год назад +8

    damn you prime, fell for it 😂

  • @mohamedaalabou6859
    @mohamedaalabou6859 Год назад +3

    Am I the only one to get Rick Rolled after clicking on Rich's "Blue Sky" link 😭

  • @konga8165
    @konga8165 Год назад +8

    What a dumpster fire. The whole ecosystem is so disorganized. JavaScript vs TypeScript vs JSDoc. npm vs yarn vs pnpm. require syntax vs import syntax. node vs deno. The list goes on.

    • @konga8165
      @konga8165 Год назад +3

      Oh and you have to setup your own linter and formatter

    • @konga8165
      @konga8165 Год назад +2

      This makes me love Rust even more

    • @catmaxi2599
      @catmaxi2599 Год назад

      Writing TS code is still a lot faster. That's the biggest difference. Rust still remains to be a low level system level programming language

    • @ea_naseer
      @ea_naseer Год назад

      There is no JavaScript Vs Typescript. It's an illusion from the way I see it.

    • @konga8165
      @konga8165 Год назад

      @@catmaxi2599 for some people, sure. I can build things a lot faster with Rust.

  • @xazzzi
    @xazzzi Год назад +13

    I don't get how JSDoc is better than TS.
    In ancient days of PHP reign we were told to avoid programming in comments, yet here we are again.
    I hope to live to see type annotation proposal flourish.

  • @vivsh.1999
    @vivsh.1999 Год назад +2

    wait what did you put in rich's bluesky link 🤣

  • @maksymiliank5135
    @maksymiliank5135 Год назад +1

    From the point of view of a library user nothing really changes, because you can still use typescript with jsdoc and lsp will work just fine. But it's still interesting to know the reasoning behind this change.

  • @DrsHWolfenstein
    @DrsHWolfenstein Год назад +17

    If this came from an avid TypeScript aficionado I would look deep into the reasoning and thoughts behind it. But Svelte has always dragged their feet when it comes to TS support. So I don't think this decision bears much weight in the grand scheme of things.

    • @DrsHWolfenstein
      @DrsHWolfenstein Год назад

      @@jurycould4275 Good catch

    • @thekwoka4707
      @thekwoka4707 Год назад

      Yeah...he's talking about using ts-node...
      And doesn't have declaration maps set up

  • @PeterBernardin
    @PeterBernardin Год назад

    All this is really a valid point, but actually we wouldn't even have these issues in the first place if TS was first-class in node like in Deno. Then you could write un-minified typescript libraries without needing transpile, retain all your types alongside the actual source files without a separate d.ts file, and be able to edit the TS directly without having re-transpile everything. Basically the best of both worlds. The only reason why we're having this conversation is because Node doesn't have native support for typescript.

  • @maxoumimaro
    @maxoumimaro Год назад +17

    Problems of js/ts devs are so weird from C/C++ dev perspective.
    Like "oh no it's a so frustrating to have compiled libs" wdym it's not convenient ?

    • @mangalegends
      @mangalegends Год назад +4

      I used to work with C++ a lot too so i know what you mean lol

    • @hamm8934
      @hamm8934 Год назад +7

      It’s a case study of the blind leading the blind

    • @mycarrysun
      @mycarrysun Год назад +2

      Yea this is a terrible reason to move away from ts...

  • @lazyh0rse
    @lazyh0rse Год назад +1

    This cleared a lot of things I didn't know, will definitely give it a try.

  • @nomadshiba
    @nomadshiba Год назад +9

    one thing i dont like about TS is it makes some sacrifices on what it can be, so JS can import and use compiled TS code

  • @MrDpof
    @MrDpof Год назад +7

    Finally someone is speaking facts. TS is garbage it's a dependency that you have to maintain up to date, you don't fully control the JS generated.
    If you need TS because of your backend you're doing it wrong. JS/TS DOES NOT BELONG TO THE BACKEND.

    • @thekwoka4707
      @thekwoka4707 Год назад

      The benefits of having a single language for the full stack and end to end typesafety is quite major.

    • @Luxcium
      @Luxcium 3 месяца назад

      if JS doesn’t belong to a place then TS doesn’t belong to that same place… if JavaScript is used in any place where it belongs or not then TypeScript should be considered… your argument of JavaScript not belonging is not an argument against TS and given you seem pretty convince I have the feeling that you do have better argument than that… what would it be??? because of course any valid argument against JavaScript in this context should be also valid against TypeScript except for exotic edge cases… Or maybe I misunderstood your point???

  • @hsdev
    @hsdev Год назад

    Its more verbose but it makes more sense (9:00). You are more likely to document your code when using JSDocs than with TS.. I am all in for JSDocs.

  • @asdqwe4427
    @asdqwe4427 Год назад +4

    Wouldn’t the best solution be if they generated js had corresponding js doc?

  • @jex8885
    @jex8885 Год назад +19

    Whenever I write TypeScript I feel like I'm always forced to start over-engineering with the type system. With JSDoc you can get type-checking and everything you need, and the code pretty much always ends up more readable and easier to maintain.
    But since nobody likes writing docs it seems like TypeScript ends up winning anyways, lol.

    • @mycarrysun
      @mycarrysun Год назад +10

      Jsdoc does not have everything that typescript can do. When you have a large frontend codebase it just does not work well enough. Typescript all the way.

    • @joshuacooks
      @joshuacooks Год назад +3

      @@mycarrysun JSDoc Types is created by the Typescript team and is 1:1 feature complete and uses typescript under the hood for tooling and introspection support.

    • @mycarrysun
      @mycarrysun Год назад +3

      @@joshuacooks might want to do some research before spreading misinfo. en.m.wikipedia.org/wiki/JSDoc it was created in 1999 well before typescript was even imagined.

    • @GuillaumeDenry
      @GuillaumeDenry Год назад +2

      @@mycarrysun He's talking about JSDoc **Types** and not JSDoc itself

  • @naranyala_dev
    @naranyala_dev Год назад +1

    Ok, this is very interesting when doing pair programming

  • @parlor3115
    @parlor3115 Год назад +29

    TLDR: TS is still the standard unless you're developing a hardcore library / framework or working in enterprise where they review all external code and won't let ship node_modules into production.

    • @iojourny
      @iojourny Год назад

      You don't have to be an enterprise to block the flaming garbage heap of potential vulnerabilities and over-complicated dependencies that is node_modules

    • @erkeliwood6037
      @erkeliwood6037 Год назад

      Is that a thing? They just write everything themselves?

    • @tonyhart2744
      @tonyhart2744 Год назад +1

      @@erkeliwood6037 military and financial institution is like these
      they write everything themselves

    • @trumpetpunk42
      @trumpetpunk42 9 месяцев назад

      ​@@tonyhart2744or copypasta!

  • @nomadshiba
    @nomadshiba Год назад +7

    3:10 why bundle libs, just ship ts and use "tsx" npm package to run it
    let js die
    who needs .d.ts while you can just use .ts

    • @fish1r1
      @fish1r1 Год назад +1

      when publishing packages

    • @nomadshiba
      @nomadshiba Год назад

      @@fish1r1 "just ship the ts"

    • @fish1r1
      @fish1r1 Год назад

      @@nomadshiba alongside js files?

  • @mathijsfrank9268
    @mathijsfrank9268 Год назад +7

    I think that jsdoc can greatly benefit from some type of type hint where your editor adds the types next to your function arguments for example, like what happens in rust when you have an implicitly typed variable. That would basically solve the readability problem.

    • @lolotronop
      @lolotronop Год назад +1

      You can actually enable inlay hints with tsserver right now in vscode settings, however it does not appear to show hints for variables that are explicitly typed in either TS (which make sense as it would just show the same text twice), or JSDoc(which is not always what you want, like in function declarations inlay hints would be helpful regardless)
      Maybe someone can make an extension or add a setting to the regular vscode to enable that

    • @mathijsfrank9268
      @mathijsfrank9268 Год назад +1

      ​@@lolotronop I think the main benefit would be if it would use the jsdoc comment and then inlay from that.

    • @MRApht
      @MRApht Год назад

      The jetbrains IDEs does that

  • @_Aarius_
    @_Aarius_ Год назад +2

    4:55 you can still do that with TS libs. TS doesn't become a big ball of mud unless you target super old versions of include aggressive minifying or obfuscation

  • @kein3001
    @kein3001 Год назад

    4:00 i usually go to definition of a liberay code to figure out how to use it in csharp. I tend not to do it in rust. There i just look at examples from the liberay documentaion.

  • @majpay
    @majpay Год назад +14

    I've always been 100% against transpiling. Just try it: next time you need to add a module to your js app - forget about webpack, vite, ts, babel and all of that. Just add a (m)js file and load it from source. Its beautyful! Makes coding fun again!

    • @Oscar08814
      @Oscar08814 Год назад

      Hello, hope you're good, is there a repo with an example of this? or a video I can watch about it? Thank you!

    • @therealestsnake
      @therealestsnake Год назад +2

      @@Oscar08814 Why would you need an example? They are saying to simply write regular JS, as is being said and done by the Svelte Kit team now. It's as simple as that.

    • @SimonBuchanNz
      @SimonBuchanNz Год назад

      I do it all the time. It's... Ok I guess? I generally don't bother above simple scripts, since it's so easy to drop in ts-node or whatever.
      There's still a bunch of sharp edges, sure, but so does every other option, including bare js and jsdoc typing.

    • @GdeVseSvobodnyeNiki
      @GdeVseSvobodnyeNiki Год назад +1

      ​@@therealestsnake just write regular js and you will eventually hate yourself, your team, your job after several 8 hours debug sessions trying to figure out what the fuck is going on in the codebase

    • @majpay
      @majpay Год назад

      @@Oscar08814 For what reason would you need that? There is nothing about it and thats the thing. Create the .js file, import the module and work with it.

  • @therealestsnake
    @therealestsnake Год назад +14

    I think there's no right or wrong. If JSDoc works for you, then use it. I'll stick with TS personally, but if there's a better option for me and my team, I'll use that.

    • @rafael.aloizio1769
      @rafael.aloizio1769 Год назад +2

      There are plenty of better options than TS, this includes js ecosystem at the end of day, you do need to solve a problem, don't you? 🎉

    • @rafael.aloizio1769
      @rafael.aloizio1769 Год назад +1

      @@Spidhey yeah I know it, although I was referring to other really cool options that end up transpiled to js, for e.g purescript, elm for FE apps, and a lot more. 😂
      TBH elm should be the mainstream tech for FE applications, the ecosystem would be gigantic, keeping a delightful DX.

    • @rafael.aloizio1769
      @rafael.aloizio1769 Год назад

      @@Spidhey you have a point, at the end of the day, it's just a matter o preferences

  • @sortof3337
    @sortof3337 Год назад +20

    also i got completely blindsided by rich's argument about changing vendor code. i didn't dive too deep into js before jumping into js and coming from the c world where that is a daydream I didn't even think typescript sucked at that. I would give up that for proper types any day though. when rich said why wouldn't you want to write your library in js, I had so many points. lmao.

    • @AR7editing
      @AR7editing Год назад +1

      can you write the points here?

    • @sortof3337
      @sortof3337 Год назад +3

      @@AR7editing I literally wrote bubble sort using types just for fun. It's a comment in jsdoc vs ts video on this channel. Typescript makes JavaScript fun even though there are quirks to it. Js is also getting better. Also I am the guy who always keeps babbling about how great typescript is if you are ever there. I don't know if it's Turing complete or not though. Also you can understand your typescript code after some years and it'll still be good enough. "Js is getting better"- you gonna have to rewrite your thingy again when that happens. Fun for someone like rich who has to modify vendor libraries he uses that he writes. Not for me who literally downloads bazillion packages from Conan or npm. Gotta get shit done. Again I don't hate JavaScript. I like types. That's it. I wish she had a type system like this. If you've ever had to do generics in c you'll understand, you can't. Void pointers are a nightmare. That's like claiming Frankenstein's monster was a real person. CPP is not a real language. I rest my case.

  • @KristofferLie
    @KristofferLie Год назад +15

    If you are already using a bundler and other code transforms, why is adding typescript the hard part? Bad excuses all around.
    Also I guess he doesn't know about d.ts maps

    • @hamm8934
      @hamm8934 Год назад +4

      Tbh he seems like a great guy, but I just think he’s an inexperienced dev that happened to hit it off with a great library but not the expertise behind him to effectively manage a project as big as svelte.
      Not trying to throw any shade at him, but just looking at his background, he only became a full time dev 2 years ago. He doesn’t have enough time to understand from experience how to navigate something like this.
      Wish him all the best.

    • @thekwoka4707
      @thekwoka4707 Год назад

      Especially when they are making exactly that... A compiler...

  • @rleddy1
    @rleddy1 Год назад

    Having done just enough (one module) of TypeScript with JSDocs, I have to say that you write the JSDoc anyway if you want the docs. So... there's redundancy. But, JSDoc could be more elegant. The TypeScript to Rust transition seemed fairly straight forward. So, if you went from JS to Rust with just JSDoc, you might have to create a tool to get the Rust forms. Similarly, TypeScript to V. So, I did not go too deep in the TS reachable types. I just wanted some JS code to be thought about more carefully than it had been. And, it was simple code, but I was making distinctions between say a transition token and a session token, which are basically the same but there are a few methods separating them. But, this did not have to do with Svelte. Happy that Svelte mostly works without reducing more years from my life like those given to other packages.

  • @thatsalot3577
    @thatsalot3577 Год назад

    I think this problem can be solved if we had some sort of TS JIT compiler/interpreter in both node and browser (atleast in dev mode) via some extension.

  • @peterszarvas94
    @peterszarvas94 Год назад +7

    deno uses typescript, you don't need to compile it; maybe node is part of the problem

    • @mycarrysun
      @mycarrysun Год назад +1

      Yup so does bun

    • @_____case
      @_____case Год назад +2

      More specifically: Deno handles the TS -> JS compilation for us so that ES modules written in either language can be used.

    • @thekwoka4707
      @thekwoka4707 Год назад +1

      Technically Deno and bun just do the transpilation in the runtime, and handles things like maps for you

  • @patrickroza3073
    @patrickroza3073 Год назад +1

    Lol, minimizing and bundling has nothing to do with typescript. You can do that with JS files too.
    TS can compile to modules just fine. Just configure it accordingly.
    I find jsdoc the wrong place for types. Back to php times. If you want to document or comment a function that’s great but I’d like to read prose not types.
    Transpilation sucks indeed and the whole move to ESM was also quite a pita. But people do this without typescript too :)

  • @bjbboy71697
    @bjbboy71697 Год назад

    Wow, I just checked out this guy's Blue Sky (linked in the description), and just wow

  • @fnfal113
    @fnfal113 Год назад

    finally a video moving away from ts, time to gear up using jsdoc

  • @devdanio
    @devdanio Год назад +3

    I feel like it's a net wash switching from TS -> JSDoc. If the biggest issue is the build steps, newer runtimes like deno and bunjs support TS right out of the box

    • @theseangle
      @theseangle 10 месяцев назад

      Tell that to frontend devs

  • @chonkusdonkus
    @chonkusdonkus Год назад +1

    Other than the cumbersome syntax, I don't dislike JSDoc, I used it before I ever tried typescript.

  • @MaxHaydenChiz
    @MaxHaydenChiz Год назад +2

    I have no real opinion on TS, but I'm not surprised that the type system is turing complete. Java's generics are. C++'s templates are. Hell HTML+CSS is turing complete IIRC.

  • @genejas
    @genejas Год назад

    19:48 i heard that capcom vs snk 2 soundbyte... You play, Prime?

  • @bljdev
    @bljdev Год назад

    I don't know why but I feel like Primeagen loves Rich Harris awkawkawka

  • @scott_itall8638
    @scott_itall8638 Год назад +1

    Love sveltekit, attempting TS but really don't want to know it.

  • @skylark.kraken
    @skylark.kraken 11 месяцев назад

    I do like comments, I do like things being unambiguous but I do have the perk of only working with myself and so I have descriptive names for everything, I use short functions so it's easy to just read what is going on and comments are only needed for the why, although I might comment a what if a lot is happening because while it is still readable it can still save dozens of seconds.
    I think the usecase for JSDoc is that it's good for when you can afford to scrutinise over every detail, you will have dozens or even hundreds of people looking at the same bit of code, it's worth putting in the extra time. While with most other projects the efficiency of TypeScript is good, I do wish people would name things better because yes people shouldn't use `a` to name anything, but at least I know what the type is.
    I think they both work. I'm going to continue to use TypeScript but I guess if I do make something that turns into something big then JSDoc is probably the way forward, it also means that when things do take off everything is going to need to be rewritten anyway and it means that no existing code can slip under the radar.

  • @kpamkar
    @kpamkar Год назад

    That's the same thing with langs that compile to lua

  • @razvangrigore322
    @razvangrigore322 9 месяцев назад

    For somebody with PHP background, I love this trend!

  • @aykutakguen3498
    @aykutakguen3498 Год назад +2

    So what am i doing wrong when i use Tsdoc @-@ (doc for documentation of the code itself and ts for types)

    • @thejaredwilcurt
      @thejaredwilcurt Год назад

      I think the bigger question is, why are you using TS just to get to TS Docs, when JSDocs skips an entire tooling system and handles types and docs for you. ESLint + eslint-plugin-jsdocs is a one-to-one replacement for TypeScript without all the downsides that come with TS.

    • @aykutakguen3498
      @aykutakguen3498 Год назад

      @@thejaredwilcurt i usually use bun. Or in the frontend vite. So working with ts is minimal overhead for me. I also prefer the syntax of ts strongly over jsdocs, jsdocs feels like its slowing me down

  • @mohammmedbaileys3461
    @mohammmedbaileys3461 Год назад

    I don’t know what my misunderstanding about TS is but I don’t understand the concept of turning a dynamic language into a pseudo-static type when I can just use a static language when I need to and a dynamic language when it’s necessary. What am I missing??

  • @Ataraxia_Atom
    @Ataraxia_Atom Год назад +2

    Prime - the weird linux person

  • @victordvickie
    @victordvickie Год назад +3

    Nice blue sky link 😂

  • @KnThSelf2ThSelfBTrue
    @KnThSelf2ThSelfBTrue Год назад

    idk you still gotta like bundle and minify your frontend code, usually. Compilation is gonna happen even if you don't use TypeScript.

  • @sncheng1771
    @sncheng1771 Год назад

    agree with 'Go to definetion'

  • @danyldezwaan
    @danyldezwaan Год назад

    Well played Prime. Well played. Never gonna give you up bae.

  • @ariezazlan5661
    @ariezazlan5661 11 месяцев назад

    What is A? When using TypeScript, it's essential to define the type and function. Just add in a comment if you dont remember, Svelte undergoes frequent changes with each update, the next upgrades on your project will just crash. Cant keep up with this framework

  • @Artybruh
    @Artybruh Год назад +2

    Am I missing something? I am listening this whole time thinking "why not use npm link or yalc and a watch build command?" I have to maintain tonnes of internal packages where I work and this is what I do when I need to develop the package and verify its changes in our main apps. JSDocs seems like a huge step backwards compared to Typescript (but I could be wrong / misunderstanding something)

    • @hamm8934
      @hamm8934 Год назад

      Nope. You’re correct.

    • @thekwoka4707
      @thekwoka4707 Год назад

      Or use tools that work with TS from the get go.
      Use declaration maps, use vitest not ts-node, etc.

  • @GetAnAndroid
    @GetAnAndroid Год назад

    Thank you for bluesky link much appreciated

  • @vikingthedude
    @vikingthedude Год назад

    But how else am I supposed to feel like a real programmer if I don’t have a compilation step?

  • @havocthehobbit
    @havocthehobbit Год назад +1

    Im really not a typescript fan, the overhead doesnt make the experience more enjoyable or productive for me just because it helps an IDE autocomplete/reference code or warns me about errors iv got used to not making from experience.
    When i want strongly typed language which is seldom in the JavaScript world, then i just go with c++ and wasm but my JavaScript experience is about rapid development with minimal type overhead. It's overly complex to achieve most tasks needed in js. Complexity that advanced TS brings can cause more problems then it solves for people who have to understand your code and collaborate with you or onboard people into a project.

  • @dinckelman
    @dinckelman Год назад +4

    I'm very confused why they didn't just enable declarationMaps and even more so why they didn't have linting rules that enforce proper documentation. It genuinely sounds like they solved a problem that didn't exist

    • @thekwoka4707
      @thekwoka4707 Год назад

      Most packages don't do declaration maps :(
      But yeah that's maintainer error.
      And why would anyone want to use ts-node?

  • @mooza.shorts
    @mooza.shorts Год назад

    I love this exchange 2:37 😂

  • @4ohf
    @4ohf Год назад

    dang this blue sky website is a true classic 😂

  • @snuffyupagus2216
    @snuffyupagus2216 Год назад

    Optional types decalarions need to be added to JS, change my mind!

  • @returncode0000
    @returncode0000 Год назад

    The Primagen fits perfectly as a new band member of Midland 😁

  • @Haustgeirr
    @Haustgeirr Год назад

    that blue sky link is savage

  • @hamm8934
    @hamm8934 Год назад +6

    God damn it. And so the wheel of frontend devs reviving a practice we moved away from for a reason turns. I kinda had hope that TS was here to stay but now all of the NPM wannabe devs are gunna follow suit.
    It’s exhausting lol.

    • @mycarrysun
      @mycarrysun Год назад +2

      Nah this guy is just crazy...I think he just destroyed his library unfortunately. I will never move away from types now.

    • @ThePrimeTimeagen
      @ThePrimeTimeagen  Год назад +9

      i swear you people don't realize you get the same type safety and the same auto complete (it literally runs from tsserver)

    • @hamm8934
      @hamm8934 Год назад +9

      @@ThePrimeTimeagen i understand that but I’m never going back to the day where we program in comments. My concern isn’t to do with svelte or Rich’s team, you do you and live your life. My concern is the waterfall effect of devs trying to bring back this practice. Not a world I want to program in again. What’s next, we’re gunna add intellisense to comments so that we can check that out JSDocs are syntacticly correct?
      Comments are for two things: blaming a previous design decision that your code base can’t go back from, and telling jokes. :)

  • @marcoio8742
    @marcoio8742 10 месяцев назад

    what about using bun and not having any build or transpilation step?

  • @riser9644
    @riser9644 Год назад

    For every library the blot grows there nothing to prevent. Few years js doc will also be bloated

  • @luisrueda4476
    @luisrueda4476 Год назад

    Typescript is just an unnecessary barrier of entry so that newcomers would think things are harder than they really are, certainly with TS they are.

  • @kzakaria91
    @kzakaria91 Год назад

    TLDR; they're both different techonologies with different trade offs, use what ever you like. SHOCKING!

  • @ChrisRoy87
    @ChrisRoy87 Год назад

    Exactly my feeling from a month ago.

  • @noah-4482
    @noah-4482 Год назад

    Just followed him on blue sky!

  • @CYXXYC
    @CYXXYC Год назад

    i've been hopping into my dependencies my entire life - in java (including java.base/java.util), in js/ts, in rust, so on

  • @raul_ribeiro_bonifacio
    @raul_ribeiro_bonifacio Год назад +2

    TS encourages type complexity. JSDocs discourages it.

    • @binitrupakheti4246
      @binitrupakheti4246 Год назад +2

      TS is more expressive than whatever JSdoc wants to be.

  • @Boxing_Gamer
    @Boxing_Gamer Год назад

    In the rust world you jump into third part code constantly though

  • @Lemmy4555
    @Lemmy4555 Год назад +5

    I don't understand how do you import "d.ts" files without going through a build step that removes your "d.ts" imports from the file

    • @ThePrimeTimeagen
      @ThePrimeTimeagen  Год назад +2

      very good point

    • @supqerior26
      @supqerior26 Год назад +5

      By importing the d.ts file in the jsdoc comment.
      /**
      * @type {import('./index.d.ts').lang}
      */
      export function lang(value)
      {
      return value;
      }

    • @Lemmy4555
      @Lemmy4555 Год назад

      @@supqerior26 Not very ergonomic since you have to "import" it every time, but yeah this works, that's true.

  • @parlor3115
    @parlor3115 Год назад +5

    Honestly, what I like to see is a nominal type system version of TypeScript.

    • @Sergeeeek
      @Sergeeeek Год назад +1

      Why?

    • @majorhumbert676
      @majorhumbert676 Год назад

      Use classes then

    • @parlor3115
      @parlor3115 Год назад +1

      @@Sergeeeek Because when you develop a function or a class method that takes in an instance of class A, you don't want to accidentally pass it an instance of class B. TS allows it if A and B have the same shape.

    • @parlor3115
      @parlor3115 Год назад

      @@majorhumbert676 What will that change?

    • @Sergeeeek
      @Sergeeeek Год назад

      @@parlor3115 yeah, it's called structural typing. I'm just curious why someone would need it

  • @amirhmahmoodi4607
    @amirhmahmoodi4607 Год назад

    Control+click is the most important concept when I use a third party package in Go and Python, I hate js and C# for lack of it

  • @johnychinese
    @johnychinese Год назад +1

    What's a mouse and what's clicking

  • @Sammi84
    @Sammi84 Год назад +1

    But the JSDoc gets typechecked by the Typescript compiler. So JSDoc _is_ Typescript.
    Why are people presenting this as a move away from TS. This is just moving the TS types to comments, so you don't have to do a compile step. It's still TS!!

  • @zackplauche
    @zackplauche Год назад

    His blue sky account is great

  • @carlosduran5460
    @carlosduran5460 Год назад

    Thanks for the bluesky link

  • @Grouiiiiik
    @Grouiiiiik Год назад +1

    I took the same path for similar reasons a few years ago.
    Types are great, typescript isn't.

  • @lucsoft
    @lucsoft Год назад +2

    Dude never heard about deno 😂like all of these problems got addressed

  • @thomassynths
    @thomassynths Год назад

    The distribution source code argument is a huge red herring. Either you have transpiled typescript or some minified unreadable code... or you have access to the dev source code.

    • @thekwoka4707
      @thekwoka4707 Год назад

      It's mainly just that many maintainers have their packages set up completely wrong.

  • @Meleeman011
    @Meleeman011 Год назад +1

    god i love the creator of svelte

  • @mekhoinfo2118
    @mekhoinfo2118 Год назад

    but what if you changed the function logic, will you remember to fix the comment(JSDoc) later? for most developers, I don't think so.

  • @duztdruid
    @duztdruid Год назад

    That Blue Sky link though 😂

  • @marcusrehn6915
    @marcusrehn6915 Год назад

    Doesnt svelte also come with it's own build step, contriuteing to the problem?

    • @thekwoka4707
      @thekwoka4707 Год назад

      They said most of the issue had to do with debugging their compiler, yes.