I get types now

OK, I finally get why type systems are so popular. Typescript, or any type system, is constantly running through ALL of your code! In a batch-and-queue programming language (like almost any programming language nowadays, really), this brings up a lot of potential issues, without you having to write thorough tests that test your system at runtime. The type system lets you determine the structure of things and to find inconsistencies.

To me, the cost paid is prohibitive, because these assertions about the system should be done with the full power of code, its same constructs (rather than a separate syntax) and at runtime. At runtime? Yes: if your system constantly runs and updates, like a spreadsheet, there’s no repetitive command you need to invoke. The system is always up to date. Any anomalies are flagged as errors that you can see.

A good runtime system that allows assertions will also allow you to see what are the assertions that a value already passed, so you can really narrow it down when you’re in a context. This runtime assertion system has all the benefits of a type system and none of its drawbacks, provided: 1) it’s always there, not just when you run your system + a test; 2) it’s integrated in the editor, so you can “see” the assertions at any point.

And, for the anarchists like me out there, that’s what we miss out on when we’re using javascript instead of typescript. We need an e2e suite to be constantly running against our system, and we still have to remember what x is at any point. Nothing less, nothing more.