Skip to content

Latest commit

 

History

History
41 lines (30 loc) · 2.44 KB

why-use.md

File metadata and controls

41 lines (30 loc) · 2.44 KB

Why Use

Enjoy some TypeScript benefits without the drawbacks of

  • Compilation time
  • New language syntax
  • Compile time only checks

With TypeCzech you can

Missing from TypeCzech

  • Type inference
  • Checking types of optional function parameters
  • Generics

TypeCzech the good parts

  • Type signatures are plain JavaScript variables made of objects, arrays, and strings. No special type variables, no annotations, and no generics.
  • Checking functions are easily detachable into a separate file. To stop all TypeCzech checking just stop importing the TypeCzech library in production or development. Decouple with a comment as in 03-Turn-Off-Library-Not-Loaded, a variable as in 102-Extending-Classes-Imports, or an if statement as in 204-Extending-Closures-Single.
  • Does not introduce special syntax into your code, just plain functions. No .d.ts files just plain JavaScript.

TypeCzech the bad parts

  • Verbosity of adding PRE_checking(), POST_checking(), and linkUp() functions to source
  • Continuously checking parameter mutations of large collections can be slow
  • When checking constructors and methods of extended classes, production code can get complicated if all TypeCzech testing code is to be completely removed for production.