3 ms·
> If you did it would immediately be caught when a test runs anyway. That's the point though. With dynamic typing you would only (hopefully) catch this with ma
by imiric 4y ago
> If you did it would immediately be caught when a test runs anyway.
That's the point though. With dynamic typing you would only (hopefully) catch this with manually written tests. With static typing you get that feedback for free at build time.
- tene 4y agoWith static types, every function signature implicitly comes with built-in tests for free.
- jacobsenscott 4y agoNot true because anyone can implement just part of an interface and throw "method undefined" for the methods they can't figure out how to implement. This happens all the time.
- KptMarchewa 4y ago> Not true because anyone can implement just part of an interface and throw "method undefined" for the methods they can't figure out how to implement. This happens all the time. How would that pass any code review, regardless of static or dynamic typing?
- tene 4y agoThe only time I have ever seen something like this is using `todo!()` while initially writing code. I have never seen someone check in code like this. What kind of clown show of a programming org are you working at? This is morally equivalent to "There's no point to having a safety on a gun, because the safety won't stop you from bashing someone in the face with the gun." If you really want to, you can throw exceptions or crash the process or call exit() or call system("shutdown -h now") anywhere in your codebase. That has nothing to do with a type system.
- KptMarchewa 4y agoEven faster, at "type time" if you use any decent IDE.