3 ms·
With static types, every function signature implicitly comes with built-in tests for free.
by tene 4y ago
With 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.