To be honest, I don't use TypeScript yet, I just found it very interesting and loved by the community so... for that reasons I decided to write this, but I have in mind to start a little project to check his good points (and the bad ones too) 👏
Having types of some sort helps me greatly in just writing functions, because it makes it much easier to remember just what data I'm messing around with. But I do tend to a functional/data-first style. So it reduces cognitive load way before you get to using tests/compiler to check things. And so, in fact, if your types are wrong your function/data manipulation will go wrong when you write it and a compiler/running tests are secondary things.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Sorry but this is just utterly false for so many reasons.
Could you list a few?
Incorrect types for open source packages, happens quite often
If you’re targeting the browser... Internet Explorer
Generics not working the way you expect them to in certain scenarios
There’s lots. It’s also just a superset of JavaScript, so any surprise JavaScript can produce, typescript can also product.
Thanks for sharing these points, Mat!
I'll investigate the cons of using TS 🤔
Don’t get me wrong, TS is a VAST improvement over JS, but it does have its own set of “gotchas”
To be honest, I don't use TypeScript yet, I just found it very interesting and loved by the community so... for that reasons I decided to write this, but I have in mind to start a little project to check his good points (and the bad ones too) 👏
That's true. But then TypeScript is getting better.
The latest change is ability to make array and record indexing return undefined. (by settings in tsconfig.)
But yes, I will never trust TypeScript to be truly safe, nor truly strongly typed.
Yeah, don’t get me wrong, TS is still a VAST improvement over JS.
and if you combine types and tests, will make the code reliable?
If you have reliable enough tests, sure. And to be clear, I still think TS is a huge improvement over JS.
Having types of some sort helps me greatly in just writing functions, because it makes it much easier to remember just what data I'm messing around with. But I do tend to a functional/data-first style. So it reduces cognitive load way before you get to using tests/compiler to check things. And so, in fact, if your types are wrong your function/data manipulation will go wrong when you write it and a compiler/running tests are secondary things.