3 ms·
Depends on the specifics, but i'm betting if `IITem` is close by i know how to interact with it. I have no clue what the hell fields or methods may or may not b
by lijogdfljk 4y ago
Depends on the specifics, but i'm betting if `IITem` is close by i know how to interact with it. I have no clue what the hell fields or methods may or may not be on `item`. Nor will i, ever. At best i have to enforce method/fields myself, at worst i subscribe entirely to duck typing and let the gods sort it out.
- jacobsenscott 4y agos/gods/tests/ - which you need even in a statically typed system.
- lijogdfljk 4y agoI don't need tests to check what methods or fields are on my types though. You need the same tests from a typed system in a non-typed. You _don't_ need all the tests from a non-typed system in a typed system. Writing tests to enforce types just hand-rolls a type system, in my experience.
- jacobsenscott 4y ago> I don't need tests to check what methods or fields are on my types though. You do though, because invariably people violate the LSP and just "throw Unimplemented" in the methods required by the interface they can't figure out how to implement. In other words all system are duck typed in reality.
- lijogdfljk 4y agoI don't, though. If it compiles, it exists. Saying that a method might actually be a nuke is a bit besides the point. It could also contain a virus. Not sure what typing system you're referring to, but it sounds very half-baked at best. I'm using Rust fwiw. I cannot access any field or method that does not exist. Even dynamic traits are compile time enforced, but i think we can largely have this discussion around static dispatch.