3 ms·
> Having a single static type system that captures all differences across all versions of all browsers is not realistic. Why? Standards and abstractions are us
by sds2 9y ago
> Having a single static type system that captures all differences across all versions of all browsers is not realistic.
Why? Standards and abstractions are useful.
> But even if it were, there's a bigger problem: static type checking happens too early. The browser can rev and change its APIs after your static type checking is performed.
At that case your program's behaviour may become inconsistent
> You want to type check with the actual runtime environment, not just a static guess at it.
That's not typechecking and there's no guarantee that your program will work with dynamic typing if the API changes.
> I guess by "graceful," not segfaulting would be a good start.
Is runtime type error better? If the type of your value changes and your assumption was false about the type then it can fail anyway with an incorrect function call.