4 ms·
This article made me laugh. I worked and am working with new typescript developers in my day job. They all go through the stages of typescript grief. - Denial
by chucklenorris 4y ago
This article made me laugh. I worked and am working with new typescript developers in my day job. They all go through the stages of typescript grief.
- Denial - This should be pretty easy, just put types everywhere!
- Anger - But my code is correct! The damn compiler doesn't understand what I mean!
- Bargaining - Can't I just use any?
- Depression - This will take forever to figure out and I have a deadline :(
- Acceptance - It's a tool like any other, it's a hassle, most of the time is useless but sometimes it saves you from bugs and makes collaboration easier.
You just have to accept that the type specification in typescript is a whole separate language that you have to learn, that takes time to write correctly.
In my experience that's at least 30% more than writing js when you know what you are doing, more when you don't. Adding the linter and tests you end up spending more time on these correctness checks than actually writing code, and that is ok, or not, depending on the project goals.
When you are writing library code this cost goes up, WAY up because your library will be used in multiple ways by different people so you have a combinatorial explosion of cases that need to be handled.
I don't understand where this expectation that writing typescript should be as easy and quick as writing js.
IMHO the typescript docs are one of the best resources (just compare them to python docs...)