▲ | kuruczgy 13 hours ago | ||||||||||||||||
Well, if your language has a sufficiently strong type system (namely, dependent types), you can take proofs of some properties as arguments. Example in Lean:
| |||||||||||||||||
▲ | whilenot-dev 12 hours ago | parent [-] | ||||||||||||||||
Sure, but the author picked TypeScript nonetheless. TypeScript is not a runtime, but a mere type checker - JavaScript is the runtime and a highly dynamic language. This detail got somehow completely lost in the article, but is IMHO the main culprit why such validations aren't bad, or sometimes even preferred. The article also skipped over the following related topics:
| |||||||||||||||||
|