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.
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.
@@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.
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.
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.
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.
@@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
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
@@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
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.
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
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
@@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.
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
Thanks to Stream for sponsoring this video!
You can try Stream for Free here: tinyurl.com/get-stream
would you create a tutorial with kotlin and stream integration?
@@alinghinea98 This is actually a good suggestion. Will add it to my todo list - thanks!
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.
Good points.
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.
@@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.
Node added "experimental-transform-types" which removes limitations of "strip-types" that you mentioned ib 22.7.0
Yep!
So called "free thinkers" when ": any"
😂
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.
Thank you!
You convinced me! I am a member!!!
I love you Awesome! ❤️
Keep up the good work, this channel is one of the best channels for JS and web dev
Thank you for the nice words! I really appreciate it!
I ❤ TypeScript
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.
😂
Also general, non TS specific coding guide: try to eliminate "else" wherever possible.
Interesting point
7:15 it's kind of annoying typescript doesn't properly account for '' being falsey too
Yep :(
Great video but I am a little bit confused. Isn't it better so said that Typescript is transpiled to JavaScript ?
JS is more flexible, but that comes with a tradeoff.
awsome content !
Thank you!
TypeScript Object Notation = TySON... Ha..ha..ha
haters gonna bring up some good points, i saw that on a t-shirt in Brooklyn.
Nice 😂
1:08
Who is that guy with such a nice moustache👨🏻?
ThePrimagen mentioned 😄 ruclips.net/video/UMEp6eFU16k/видео.html
Gottem!
typescript is not a fix but a patch
beautiful
rm -rf node_modules
done
Ok.. now what? 😅
If video published few mins ago, how come comment is 18 hours ago
Scheduled messages !?
But love your vids
Hey! It was published early for chanel members 👍🏻
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
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.
its hightime they add the type in js itself
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
Sadly I don't think this is going to happen.
JSDoc is the most we can have.
@@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
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
@@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
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.
Python and PHP are dynamically typed, just like JS. TS tries to alleviate that by enforcing some type safety.
Hahahahha what’s in the box
😅✌🏻
Please learn about the real difference between types and interfaces and release a video where you accept your mistake
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
@@alinghinea yes and while talking about the difference between type and interface in typescript, omitting this shows person does not understand
we got baited, i though this was about typescript.
What is it about?
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
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
I fully agree :D That's what I said in the video.
There actually is, check out Matt's article on that...
@@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.
Also typescript, 'any', 'unknown', 'never' 🫠
"never" is actually shockingly useful, so is "unknown" to be fair.
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
@@carneloot exactly!