4 ms·
It's great that you always write bug free code, but then typescript was not written for you, it was written for the rest of us who write the occasional bug, ref
by JamesBarney 7y ago
It's great that you always write bug free code, but then typescript was not written for you, it was written for the rest of us who write the occasional bug, refactor an API that we didn't realize another developer was using, or can't quite remember the order or shape of args that a library call takes that we only use once every 6 months.
- deleted 7y ago[deleted]
- arkanciscan 7y agoWhy don't your tests catch your TypeErrors? You do have tests don't you?
- Can_Not 7y agoTests aren't an alternative to types. They're better together.
- stevenwliao 7y agoWhy would you write a test instead of a type declaration if you had the choice?
- arkanciscan 7y agoTS checks at buildtime. It can't guard against runtime TypeErrors because JavaScript is a dynamic language (despite all the effort to "fix" that). Tests can catch all TypeErrors, TS can't. Why use two tools to do the job that one can do alone?