Re:TypeScript Roadmap 2019
by austincheney on Friday January 11, 2019 @12:58AM
(#18881326)
True. Consider this example:
TypeScript's strict types will see the error if the those are not the same data type. A TypeScript aware editor will yell at me before I compile the code. Perhaps what I really wanted is:
In JavaScript I would have to execute the code. If the code doesn't throw an error then I would have to examine the output to see if the resulting data structure matches what I expect. If not I have to run tests and track down the error. Then once the error is found and resolved I have to write unit tests for this scenario.
[ Parent
| on HN ]
You can use an auto-generated intermediate format when running the tests, that check each member object, give test coverage, etc. Eg. a tool that parses the code and inserts a bunch of checks above each member access. So you start with plain JavaScript, and you ship plain JavaScript.