Re:An introduction to type programming in TypeScript
by zkldi on Wednesday February 02, 2022 @10:28AM
(#30178899)
[] - {}
is a fatal typescript error[0]. A well configured linter can also catch out similar nonsense, but
[] - 2
does get past the compiler.The TS Compiler can atleast stop you from doing nonsense like applying operators to types where they don't make sense. Of course, it'd be better if JS just threw an error or something, but atleast TS can stop you.
[0]: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.ts(2363)
Yeah, is it. But "complexity" is fine:
What is a big trouble is when the complexity is NOT intentionally designed (ie: in languages like oCalm, Rust, Coq...) but instead the type system is a lie that bring "complications": Humans can deal with complexity if is part of a intentional design (example: APL), but what we dread is when is accidental...