TypeScript The Right Way

  Рет қаралды 20,358

Awesome

Awesome

Күн бұрын

Пікірлер: 67
@awesome-coding
@awesome-coding 15 күн бұрын
Thanks to Stream for sponsoring this video! You can try Stream for Free here: tinyurl.com/get-stream
@alinghinea98
@alinghinea98 14 күн бұрын
would you create a tutorial with kotlin and stream integration?
@awesome-coding
@awesome-coding 14 күн бұрын
@@alinghinea98 This is actually a good suggestion. Will add it to my todo list - thanks!
@Thassalocracy
@Thassalocracy 14 күн бұрын
Just to add, besides being a "linter" or JS with types, TS also has variants that are being used in other platforms like AssemblyScript (Wasm), DeviceScript (microcontrollers) and - surprise - Huawei's HarmonyOS and OpenHarmony. It's also first class supported in React Native.
@awesome-coding
@awesome-coding 14 күн бұрын
Good points.
@coder_one
@coder_one 13 күн бұрын
AssemblyScript inspired its syntax with that known from TS. In practice, there is no argument for the claim that AssemblyScript is some variant of TypeScript. If one were to succumb to your logic, one would have to say that TS is a variant of C# because they have a convergent syntax and the same inventor.
@Thassalocracy
@Thassalocracy 13 күн бұрын
​@@coder_one from the docs: "AssemblyScript compiles a variant of TypeScript (a typed superset of JavaScript) to WebAssembly using Binaryen." You can argue all you want that somehow AS and TS are two very different languages if that makes you feel C# is not TS, but the AS creators beg to differ.
@Deathkyun
@Deathkyun 14 күн бұрын
So called "free thinkers" when ": any"
@awesome-coding
@awesome-coding 14 күн бұрын
😂
@ChichaGad
@ChichaGad 14 күн бұрын
Lmfao!!
@ashleyfreebush
@ashleyfreebush 14 күн бұрын
You convinced me! I am a member!!!
@aissa-dev1
@aissa-dev1 14 күн бұрын
I ❤ TypeScript
@mikevaleriano9557
@mikevaleriano9557 12 күн бұрын
The typescript subreddit has daily questions from uber smart people: "HOW DO I MAKE THIS SIMPLE CODE COMPLETELY ILLEGIBLE FOR THE SAKE OF USING MULTIPLE LEVELS OF GENERICS JUST TO MAKE ME SEEM SMART"? It's exhausting.
@awesome-coding
@awesome-coding 12 күн бұрын
😂
@cocoscacao6102
@cocoscacao6102 12 күн бұрын
JS is more flexible, but that comes with a tradeoff.
@lazyh0rse
@lazyh0rse 14 күн бұрын
I just wish that typescript was like python or php, in that it's optional to define types, but it doesn't enforce it. It's nice to have, but when it nags you on the smallest variables it ruins the fun for me.
@awesome-coding
@awesome-coding 14 күн бұрын
Python and PHP are dynamically typed, just like JS. TS tries to alleviate that by enforcing some type safety.
@wwloyd
@wwloyd 14 күн бұрын
I just cant stand overly verbose and way too much complexed TS in codebase, keep it simple is the most important takeaway from this video
@awesome-coding
@awesome-coding 14 күн бұрын
Yep! It clearly is a developer problem, not a language problem. TS allows you to be as flexible as you want, but some people just love extremely complex types.
@myman_man_man
@myman_man_man 14 күн бұрын
ThePrimagen mentioned 😄 kzbin.info/www/bejne/i36ooWmbe7pkbM0
@awesome-coding
@awesome-coding 14 күн бұрын
Gottem!
@yashasmn245
@yashasmn245 14 күн бұрын
If video published few mins ago, how come comment is 18 hours ago Scheduled messages !? But love your vids
@awesome-coding
@awesome-coding 14 күн бұрын
Hey! It was published early for chanel members 👍🏻
@ulrich-tonmoy
@ulrich-tonmoy 14 күн бұрын
its hightime they add the type in js itself
@petaflop3606
@petaflop3606 14 күн бұрын
what's the point? js has deep commitment to backwards compatibility. Which means any type system would be opt in. Which is what typescript is
@awesome-coding
@awesome-coding 14 күн бұрын
Sadly I don't think this is going to happen. JSDoc is the most we can have.
@ulrich-tonmoy
@ulrich-tonmoy 14 күн бұрын
@@awesome-coding it could improve the performance and they can do if theres no type annotated code it should be considered any that way it wont break compatibility. one of the reason why they wont is probably typescript own by ms i guess
@christian-schubert
@christian-schubert 14 күн бұрын
My thoughts EXACTLY, THANK YOU for pointing this out! Typescript has always felt like a half-baked crutch to me... I'm all for introducing a statically typed JavaScript option, but it's time we went all in, analogous to the likes of Java, C++, etc., offering specific variable type naming like "string", "int", "double", "bool", "void" alongside "Const", "let", "var" and "function" instead of awkwardly postfixing types the way Typescript does it
@unknownguywholovespizza
@unknownguywholovespizza 14 күн бұрын
​@@christian-schubertI'm totally the opposite. I love postfixing types like in Rust. It's much better to think about the name of the variable first, then type it. I literally hate languages that prefix types
@bigmistqke
@bigmistqke 14 күн бұрын
7:15 it's kind of annoying typescript doesn't properly account for '' being falsey too
@awesome-coding
@awesome-coding 13 күн бұрын
Yep :(
@watchchat
@watchchat 14 күн бұрын
Hahahahha what’s in the box
@awesome-coding
@awesome-coding 14 күн бұрын
😅✌🏻
@hazfrd
@hazfrd 14 күн бұрын
Why in the world someone use typescript man, it should be only applied for library and use jsdocs for the rest of your jscode in case needed
@lengors7327
@lengors7327 14 күн бұрын
If you dont know the shape of the type you should use (drumrolls please)... unknown. There's 0 reasons to use any at this day and age in typescript, prove me wrong
@awesome-coding
@awesome-coding 14 күн бұрын
I fully agree :D That's what I said in the video.
@zayne-sarutobi
@zayne-sarutobi 12 күн бұрын
There actually is, check out Matt's article on that...
@lengors7327
@lengors7327 12 күн бұрын
@@zayne-sarutobi I agree with first one. Though that one is quite a bit exceptional. It's similar to `T extends any`, it doesn't actually disable typescript in the same way declaring a variable as `any` does, as typescript will make the generic as specific as possible when used. But, fair enough. As for the second use case, I'm not convinced. Imo it's a sign of bad design. For his specific example you can achieve the same behavior without actually using any casts.
@ohhellothere17
@ohhellothere17 14 күн бұрын
Also typescript, 'any', 'unknown', 'never' 🫠
@thegreatxc
@thegreatxc 14 күн бұрын
"never" is actually shockingly useful, so is "unknown" to be fair.
@carneloot
@carneloot 14 күн бұрын
The only problem here is any, which basically defeats the purpose of using typescript. Unknown and never are useful tools to build safer and better types
@alinghinea98
@alinghinea98 14 күн бұрын
@@carneloot exactly!
@bean_TM
@bean_TM 14 күн бұрын
Node added "experimental-transform-types" which removes limitations of "strip-types" that you mentioned ib 22.7.0
@awesome-coding
@awesome-coding 14 күн бұрын
Yep!
@ChichaGad
@ChichaGad 14 күн бұрын
I love you Awesome! ❤️ Keep up the good work, this channel is one of the best channels for JS and web dev
@awesome-coding
@awesome-coding 13 күн бұрын
Thank you for the nice words! I really appreciate it!
@cryptonative
@cryptonative 14 күн бұрын
typescript is not a fix but a patch
@vpetryniak
@vpetryniak 19 сағат бұрын
1:08 Who is that guy with such a nice moustache👨🏻?
@garretmh
@garretmh 14 күн бұрын
Man, even when I’m well familiar with everything covered in one of your videos I like to watch them. They’re just nice, and they’re a good reference for talking with junior devs.
@awesome-coding
@awesome-coding 14 күн бұрын
Thank you!
@psyferinc.3573
@psyferinc.3573 13 күн бұрын
beautiful
@MatheusPereira-nn9dj
@MatheusPereira-nn9dj 14 күн бұрын
awsome content !
@awesome-coding
@awesome-coding 14 күн бұрын
Thank you!
@georgehelyar
@georgehelyar 14 күн бұрын
rm -rf node_modules done
@awesome-coding
@awesome-coding 14 күн бұрын
Ok.. now what? 😅
@lazycyclone
@lazycyclone 14 күн бұрын
Please learn about the real difference between types and interfaces and release a video where you accept your mistake
@alinghinea
@alinghinea 14 күн бұрын
What mistake? Maybe he could have completed with a difference that a type cannot be re-opened to add new properties vs an interface which is extendable
@lazycyclone
@lazycyclone 13 күн бұрын
@@alinghinea yes and while talking about the difference between type and interface in typescript, omitting this shows person does not understand
@trontrontrontron4
@trontrontrontron4 14 күн бұрын
we got baited, i though this was about typescript.
@awesome-coding
@awesome-coding 14 күн бұрын
What is it about?
Microservices Gone Wrong at DoorDash
17:22
NeetCodeIO
Рет қаралды 123 М.
The Right Way To Build REST APIs
10:07
Awesome
Рет қаралды 104 М.
Incredible: Teacher builds airplane to teach kids behavior! #shorts
00:32
Fabiosa Stories
Рет қаралды 10 МЛН
Running With Bigger And Bigger Lunchlys
00:18
MrBeast
Рет қаралды 100 МЛН
Being Competent With Coding Is More Fun
11:13
TheVimeagen
Рет қаралды 79 М.
Bash? Nah, I Have Bun.
12:38
Theo - t3․gg
Рет қаралды 73 М.
Software Engineers have no Deep Knowledge in 2024?
8:54
Roman V.
Рет қаралды 7 М.
Why Everyone Loves Zustand
29:27
Theo - t3․gg
Рет қаралды 82 М.
Why use Type and not Interface in TypeScript
14:12
ByteGrad
Рет қаралды 207 М.
Node.js Doesn’t Suck Anymore
16:59
Web Dev Simplified
Рет қаралды 111 М.
Microservices are Technical Debt
31:59
NeetCodeIO
Рет қаралды 307 М.
How Did I Not Know This TypeScript Trick Earlier??!
9:11
Josh tried coding
Рет қаралды 212 М.
The 3 Laws of Writing Readable Code
5:28
Kantan Coding
Рет қаралды 577 М.
Incredible: Teacher builds airplane to teach kids behavior! #shorts
00:32
Fabiosa Stories
Рет қаралды 10 МЛН