3 ms·
> They can be enforced, for example, by policy, e.g. "Don't push anything that produces warnings to the master branch". I laughed out loud when I read this. F
by TulliusCicero 4y ago
> They can be enforced, for example, by policy, e.g. "Don't push anything that produces warnings to the master branch".
I laughed out loud when I read this.
Funny thing is, this would work where I'm at now, Google, because Google actually has an enormous number of presubmit checks that require all KINDS of things out of your code, it's practically crazy how many checks it runs. Since there's already so much setup for these checks, yeah adding one more would be fine (and it already does this for type annotations for dynamically typed languages like Javascript).
But most places aren't Google, and it's way more realistic to prevent this kind of problem by just having a language that'll enforce it automatically, then you never have to think about it, or have a policy debate, or always make sure during code review to look for that thing, etc.
If I'm putting out some small open source library where I might get an occasional pull request, I'd much rather have the language automatically enforce correct typing than have to remember to look for it myself every time (and then possibly miss something if I screw up).