Why YOU should migrate to TypeScript

TypeScript is now the most popular language on GitHub. Learn why everyone's going mad for it.
00:00 Intro
00:29 Undefined is not a function
01:44 Securing your own code
03:07 Libraries
04:38 Third-party API's
05:46 Get out of jail free
Become a TypeScript Wizard with Matt's upcoming TypeScript Course:
www.totaltypescript.com/
Follow Matt on Twitter
/ mattpocockuk

Пікірлер: 55

  • @EseEmeEse
    @EseEmeEse Жыл бұрын

    I'll show this video to my team.

  • @mattpocockuk

    @mattpocockuk

    Жыл бұрын

    Yesssss, join the army

  • @Noway1252
    @Noway1252 Жыл бұрын

    I absolutely love TypeScript. Sure i have to type more but that is totally fine with me as long as i know the type of the parameters that I have to pass to a function and the returned value. Your videos on what one can do with generics are awesome 😀

  • @mattpocockuk

    @mattpocockuk

    Жыл бұрын

    Thanks pal!

  • @johnbull-dev
    @johnbull-dev Жыл бұрын

    5 years working with TypeScript and I don't see why others dislike it. Always good to have some extra checking and helpers.

  • @Beastintheomlet
    @Beastintheomlet Жыл бұрын

    This comment is to show engagement to the almighty algorithm. Great video and I look forward to more.

  • @mattpocockuk

    @mattpocockuk

    Жыл бұрын

    Thank you for your engagement!

  • @oneofone_1333
    @oneofone_1333 Жыл бұрын

    Hi Matt Love the way you teach. Is your course coming this year and how long will it be😁can't wait. Love from Switzerland

  • @rapske50
    @rapske50 Жыл бұрын

    Love ya work Matt

  • @felipegutierrez2944
    @felipegutierrez2944 Жыл бұрын

    I love to see TS with React, Solid or any JS framework type save, This content is awesome!

  • @harrytsang1501

    @harrytsang1501

    Жыл бұрын

    Typescript is still not foolproof. const objects can still be mutated, and that makes a lot of invisible bugs especially when you are working with legacy code

  • @ogreeni

    @ogreeni

    Жыл бұрын

    @@harrytsang1501 const objects should be mutated. Objects are reference types, and the only thing const guarantees is that the reference will not change. Same with arrays.

  • @joshuanance664
    @joshuanance664 Жыл бұрын

    I'm going to be trying to convince my company to switch to TS soon. Thanks for doing videos like this.

  • @davepascual39
    @davepascual39 Жыл бұрын

    I just learned Typescript 2 months recently. From what I learned form it, it made my coding much more fast and predictable especially when I need to know all the possible methods a an object.

  • @monfernape
    @monfernape Жыл бұрын

    Loved the 💢 expressions

  • @mattpocockuk

    @mattpocockuk

    Жыл бұрын

    My speciality

  • @MusicRelatedCandy
    @MusicRelatedCandy Жыл бұрын

    Please can you do a video and deconstruct how the types for Express' app.get parses the path params?

  • @brokula1312
    @brokula1312 Жыл бұрын

    It's been a long time Matt.

  • @mattpocockuk

    @mattpocockuk

    Жыл бұрын

    👋

  • @SahraClayton
    @SahraClayton Жыл бұрын

    Hi Matt, I am only a beginner in learning Javascript and React, I watch and enjoy your videos as i do find them interesting and you do explain concepts very well. However I get the basics of Typescript like declaring number type in parameters but I have watched your videos and there are things like keyof, extends, T, K, key, generics. it is hard enough to learn Javascript on it's own let alone with all the complicated extra boilerplate

  • @mattpocockuk

    @mattpocockuk

    Жыл бұрын

    The amazing thing about TS is that you can be INCREDIBLY productive with it while only knowing 5% of its feature set. If the complicated stuff doesn't interest you, you don't need to learn it. What I personally found was knowing the advanced stuff made me more able to create better API's for my team members, so advanced me very quickly to being a senior/lead TS dev. But if your focus is on shipping (as it should be when starting out) then just focus on the basics.

  • @ivanpartida7467
    @ivanpartida7467 Жыл бұрын

    Is it possible to get that type inference from the route string when separating the callback function from the router function?

  • @spitefol5504
    @spitefol5504 Жыл бұрын

    how would you recommend learning typescript and learning it well, what resources?

  • @siveroo7493
    @siveroo7493 Жыл бұрын

    ive been using typescript for 1 year and i loved it. i got my first job last week as a backend dev but they use python and golang. so now i have to move away FROM typescript, and focus to learn those languages instead. feel a little sad but at least i get paid now 😅, anyway man, i love ur typescript stuff, it was really helpful when i was a beginner

  • @mattpocockuk

    @mattpocockuk

    Жыл бұрын

    That's great to hear pal. I'm sure TypeScript will call you back when it's time

  • @nabinsaud4688
    @nabinsaud4688 Жыл бұрын

    I started using typeScript 3 months ago

  • @bideshbanerjee5506
    @bideshbanerjee5506 Жыл бұрын

    In my experience I was really scared to try typescript. But it's just the matter of one project after that there is no looking back to JS....♥️♥️

  • @Edward0TheGreat
    @Edward0TheGreat Жыл бұрын

    Hey Matt, any particular advice on when to use a text enum vs a union of strings? I like the idea of using an enum where if a value ever needs to change, you don't have to worry about checking for all occurrences, but I find it ends up being a real annoyance when trying to write a type guard at times, where I have to write type predicate functions that confirm it as a member of the enum, rather than TypeScript being able to infer that it's in the enum by matching the strings.

  • @mattpocockuk

    @mattpocockuk

    Жыл бұрын

    I pretty much always go for string unions. Much easier to deal with and no need to import.

  • @Edward0TheGreat

    @Edward0TheGreat

    Жыл бұрын

    @@mattpocockuk Thanks so much for responding! Is this one of those situations where you feel there is a valid use-case for using enum, but simply that you don't run into it often? Or do you tend to think that's your preferred method in every case?

  • @mattpocockuk

    @mattpocockuk

    Жыл бұрын

    @@Edward0TheGreat My default position is to not use enums, I generally only use them when I really really feel the need (which is rare)

  • @magne6049
    @magne6049 Жыл бұрын

    0:01 Is Wizardry a good thing? Whether in TypeScript or any other kind of programming. Genuinely curious. Because "magic" has been one of the most frequent complaints hurled against programming languages and frameworks for years.

  • @mattpocockuk

    @mattpocockuk

    Жыл бұрын

    I'm going more for the _feeling_ of being a wizard, like you have total control and everything feels easy.

  • @magne6049

    @magne6049

    Жыл бұрын

    @@mattpocockuk can't escape the fact that a lot of what you do is also TS wizardry ;-)

  • @beatsbycf
    @beatsbycf Жыл бұрын

    The only time I get errors with typescript is when a package is compiled with the wrong importing implementatiom

  • @neociber24
    @neociber24 Жыл бұрын

    I was doing a React test in JS and was a nightmare because typing, I lost 1 hour looking through the src just to understand the fields of an object.

  • @mattpocockuk

    @mattpocockuk

    Жыл бұрын

    That's interesting. I find the TS types with React really nice, and combine them all the time in prod. Do you remember specifically which error you came up against?

  • @neociber24

    @neociber24

    Жыл бұрын

    @@mattpocockuk The test required to fix methods of a reducer (using redux/toolkit). I made a lot of silly type errors: - Wrongly copied an array using object { ...array }. - I forgot about action.payload field - Other is that in some cases some actions had an action.payload.data field which I didn't knew.

  • @functnal3187
    @functnal3187 Жыл бұрын

    What in his VS Code is making the code show up as if its guessing what he's going to type next?

  • @mattpocockuk

    @mattpocockuk

    Жыл бұрын

    GitHub Copilot

  • @gubatenkov
    @gubatenkov Жыл бұрын

    Why YOU should finish your advanced typescript course

  • @mattpocockuk

    @mattpocockuk

    Жыл бұрын

    All the content is written, just recording it now!

  • @gubatenkov

    @gubatenkov

    Жыл бұрын

    ​@@mattpocockuk we have been waiting for this course for more than 3 months

  • @mattpocockuk

    @mattpocockuk

    Жыл бұрын

    ​@@gubatenkov I ain't rushing it!

  • @gubatenkov

    @gubatenkov

    Жыл бұрын

    @@mattpocockuk It's okay, we're not rushing you

  • @watchandenjoy1043
    @watchandenjoy1043 Жыл бұрын

    Ok

  • @a89529294
    @a89529294 Жыл бұрын

    🤴

  • @DrWarpMan
    @DrWarpMan Жыл бұрын

    04:38, this is something I struggle to understand when moving onto TypeScript. If I am not in control of the 3rd Party API. What if they suddenly change the response and the hair_color will be of type number? Why should I type the response, if I can't guarantee the response will be of that type. Shouldn't I check it via JS anyway? So you do hair_color: string, but then shouldn't you also do additional checks in your JS code like .. if typeof hair_color === "string" continue, otherwise throw error or something?

  • @mattpocockuk

    @mattpocockuk

    Жыл бұрын

    Absolutely, you should use Zod in these cases. Zod gives you runtime safety AND type safety.

  • @alexbechmann594

    @alexbechmann594

    Жыл бұрын

    @@DrWarpMan If they have an Open API spec you can codegen types from it

  • @michaelbitzer7295
    @michaelbitzer7295 Жыл бұрын

    Typescript is amazing untill autocomplete takes 40 seconds. The type checker is so painfully slow even on smaller projects.

  • @CarlosRangel
    @CarlosRangel Жыл бұрын

    i thought this was going to be about taylor swift from the title :/

  • @RedStone576
    @RedStone576 Жыл бұрын

    na im good