The Hardest Part Of TypeScript

  Рет қаралды 7,080

Colt Steele

Colt Steele

Күн бұрын

Let's talk TypeScript Generics! Coupon for my new TypeScript course: www.udemy.com/course/learn-ty...

Пікірлер: 35
@RodrigoDAgostino
@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
@Donkle365 Жыл бұрын
I would love that for sure, the value of his courses is phenomenal (that is, if you want to learn the topic)
@diegosepulveda8691
@diegosepulveda8691 11 ай бұрын
Colt is awesome, he knows what every student struggle and explain it like no other
@andrecoetzer7032
@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
@johnm8358 Жыл бұрын
Thought I escaped generics when I stopped java programming
@kresimircosic3753
@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
@logvnjs Жыл бұрын
Awesome video! keep them coming! You are probably my favorite teacher!
@mentoriii3475
@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
@davidgentilli7944 Жыл бұрын
Great explanation!
@petecapecod
@petecapecod Жыл бұрын
Thanks Colt, that was just what I needed! 🙌🏻 Also love that the VS Code TS wheel is spinning the whole time 🤣
@Mitsunee_
@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
@leonardocitton4627 Жыл бұрын
great tutorial, thanks!
@OfficialFendre
@OfficialFendre Жыл бұрын
Thanks it was very helpful!
@DruSerkes
@DruSerkes Жыл бұрын
Yeah I’m gonna have to get this course now
@sobeyyy
@sobeyyy Жыл бұрын
Great video!
@ziyadkader6767
@ziyadkader6767 Жыл бұрын
thanks, great video ! please do a video on the infer keyword and the type keyword and complex types
@MailsonWei
@MailsonWei Жыл бұрын
great video thanks
@himbary
@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
@bez1196 Жыл бұрын
Are you self taught?
@himbary
@himbary Жыл бұрын
@@bez1196 yes
@bez1196
@bez1196 Жыл бұрын
@@himbary how long did you study before you felt ready to start applying? Did you make your portfolio projects in vanilla JS?
@SK74102
@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
@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 😀👍
@jellyfish1772
@jellyfish1772 9 ай бұрын
Thank you sir
@cogwheelLearning
@cogwheelLearning Жыл бұрын
pretty cool🏆
@jellyfish1772
@jellyfish1772 9 ай бұрын
well dire scared me
@mattiarasulo9934
@mattiarasulo9934 Жыл бұрын
Why using this super-complex syntax when js does everything for you? 🤔
@t.roll21
@t.roll21 Жыл бұрын
3rd
@dasten123
@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
@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
@wasd3108 Жыл бұрын
"complex enough" what? xD pretty sure this can be seen as basics
@Thorax232
@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
@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
@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
@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.
How To Use TypeScript With Express & Node
17:05
Colt Steele
Рет қаралды 61 М.
JS Arrow Functions: Everything You Need to Know
20:23
Colt Steele
Рет қаралды 31 М.
I PEELED OFF THE CARDBOARD WATERMELON!#asmr
00:56
HAYATAKU はやたく
Рет қаралды 36 МЛН
ПЕЙ МОЛОКО КАК ФОКУСНИК
00:37
Masomka
Рет қаралды 9 МЛН
Зомби Апокалипсис  часть 1 🤯#shorts
00:29
INNA SERG
Рет қаралды 7 МЛН
The Noodle Stamp Secret 😱 #shorts
00:30
Mr DegrEE
Рет қаралды 64 МЛН
JavaScript Getters and Setters Explained
9:11
Colt Steele
Рет қаралды 19 М.
TypeScript Crash Course
52:27
Traversy Media
Рет қаралды 580 М.
Generics: The most intimidating TypeScript feature
18:19
Matt Pocock
Рет қаралды 159 М.
Learn TypeScript Generics In 13 Minutes
12:52
Web Dev Simplified
Рет қаралды 203 М.
SQL Window Functions in 10 Minutes
10:13
Colt Steele
Рет қаралды 53 М.
Master JavaScript Array Reduce Method In 10 Minutes
10:51
Colt Steele
Рет қаралды 6 М.
Git Rebase Vs. Merge
19:59
Colt Steele
Рет қаралды 105 М.
TypeScript Tutorial for Beginners
1:04:28
Programming with Mosh
Рет қаралды 1,1 МЛН
I PEELED OFF THE CARDBOARD WATERMELON!#asmr
00:56
HAYATAKU はやたく
Рет қаралды 36 МЛН