Let's talk TypeScript Generics! Coupon for my new TypeScript course: www.udemy.com/course/learn-ty...
Пікірлер: 35
@RodrigoDAgostino Жыл бұрын
I finished your TypeScript course a couple of weeks ago, and I must say it is pretty solid, I enjoyed it quite a lot. I wish there was a Colt Steele’s course for every single thing I wanna learn :)
@Donkle365 Жыл бұрын
I would love that for sure, the value of his courses is phenomenal (that is, if you want to learn the topic)
@diegosepulveda869111 ай бұрын
Colt is awesome, he knows what every student struggle and explain it like no other
@andrecoetzer7032 Жыл бұрын
Colt just wanted to say thank you again. I recently enrolled in a part time university and I can't tell you enough how incredible your web dev on udemy is compared to what they teaching at this university. I'm basically just there for the qualification. If it wasn't for you my dream of being a dev would not be viable. Thank you
@johnm8358 Жыл бұрын
Thought I escaped generics when I stopped java programming
@kresimircosic3753 Жыл бұрын
Just think of them as variables for types. You are telling your editor that this here is gonna be of my type named User. The editor can then assume that everything inside the code that references that variable that was of type is now User, and it knows it's an object that has certain properties, methods etc...
@logvnjs Жыл бұрын
Awesome video! keep them coming! You are probably my favorite teacher!
@mentoriii3475 Жыл бұрын
for anyone wondering we can have multiple generic types in the same function for example: sample(arr:T[], num:V, str:Y) also we can have generic interface properties
@davidgentilli7944 Жыл бұрын
Great explanation!
@petecapecod Жыл бұрын
Thanks Colt, that was just what I needed! 🙌🏻 Also love that the VS Code TS wheel is spinning the whole time 🤣
@Mitsunee_ Жыл бұрын
as a fun challenge for generics try to type a reimplementation of the map and reduce methods Arrays have. Just had to do that today for my List class (based on the doubly linked list from your JS Algorithms course that I really need to go continue at some point) and it was really amazing when I got it to work the way I wanted it to where the type is automatically inferred based on the callback return types :)
@leonardocitton4627 Жыл бұрын
great tutorial, thanks!
@OfficialFendre Жыл бұрын
Thanks it was very helpful!
@DruSerkes Жыл бұрын
Yeah I’m gonna have to get this course now
@sobeyyy Жыл бұрын
Great video!
@ziyadkader6767 Жыл бұрын
thanks, great video ! please do a video on the infer keyword and the type keyword and complex types
@MailsonWei Жыл бұрын
great video thanks
@himbary Жыл бұрын
I used to watch your web development courses as a beginner and now I work full time employed with typescript. Thank you 🙏 Generics are the one thing I always struggle with. Would love to see more TS content.
@bez1196 Жыл бұрын
Are you self taught?
@himbary Жыл бұрын
@@bez1196 yes
@bez1196 Жыл бұрын
@@himbary how long did you study before you felt ready to start applying? Did you make your portfolio projects in vanilla JS?
@SK74102 Жыл бұрын
Thanks. I was just struggling to understand generics. I'm also not sure when I should use interfaces over types or vice versa. I recall reading somewhere that some use the former for behavior and the latter for data.
@paulclarke4099 Жыл бұрын
Excellent, would love to see you cover a minimalistic set of basic TypeScript that offers the biggest ROI for the minimum investment in TypeScript. I think a full on implementation of TypeScript is overkill for the average JS developer but the basic concepts like typed variables and parameters to functions, enums and basic generics as you have shown here certainly offer a big ROI for just a small effort. Thanks Colt 😀👍
@jellyfish17729 ай бұрын
Thank you sir
@cogwheelLearning Жыл бұрын
pretty cool🏆
@jellyfish17729 ай бұрын
well dire scared me
@mattiarasulo9934 Жыл бұрын
Why using this super-complex syntax when js does everything for you? 🤔
@t.roll21 Жыл бұрын
3rd
@dasten123 Жыл бұрын
No, this is not the hardest part of TypeScript. This is the hardest part of TypeScript: interface Bogus) | Parameters & (Length extends 0 | 1) ? F : (arg_0: typeof E => R>: (type: T extends { 0: infer U } ? [U] : T extends { 0?: infer U } ? [U?] : never;
@gidmanone Жыл бұрын
exactly. I dont blame Colt Steele. the man probably doesn't use Typescript as a developer. He is a teacher don't forget .
@wasd3108 Жыл бұрын
"complex enough" what? xD pretty sure this can be seen as basics
@Thorax232 Жыл бұрын
Generics are scary for first-time programmers. So, it's on the complex side of the basics. But you're right, still in that category.
@gidmanone Жыл бұрын
I don't think generics per se is what trips people up. What trips people up is Conditional Types. Those Type challenges and gymnastics that are entirely done in "Type land". Here is what I'm talking about 👇 👇 type ParseQueryString = S extends '' ? {} : Tokenize extends infer Q ? { [K in (Q & [string, unknown][])[number][0]]: Normalize } : never
@Thorax232 Жыл бұрын
I wish the course got more into this. I feel like anyone ready to learn TS could have picked up all that information very quickly from docs and trial/error. Or just any course that uses typescript could cover its topics "inline" without confusing much. TypeScripts type system is (allegedly) Turing complete. This allows for some pretty crazy-looking types like this. I wish he would have gone as in-depth with TS as he did for the Git bootcamp.
@gidmanone Жыл бұрын
@@Thorax232 Thank you for this input. There are literally no course out there that goes deep into the actual Type System and it's super frustrating. I thought I was going to find that in this course.