3 ms·
The problem balancing implementation vs ontological inheritance while providing strong type safety is that your language needs to either support defining contra
by fnl 9y ago
The problem balancing implementation vs ontological inheritance while providing strong type safety is that your language needs to either support defining contravariant types (and you still likely end in a mess, see Scala's eternal discussion about "total" type safety), or you disallow ontological inheritance completely (like Golang, and therefore cannot support many modern programming features, for the better or worse, doesn't matter). Not sure if there is a language that truly does the opposite by design, though (being strongly typed and disallowing implementation inheritance, while providing ontological inheritance). Such a language might be the DDD modeller's heaven? :-)
- weberc2 9y ago> or you disallow ontological inheritance completely (like Golang, and therefore cannot support many modern programming features Sincerely, what features does this preclude. I pretty much ignore ontological inheritance in any programming language because it never seems useful. Am I missing something?
- yen223 9y agoSame here. The whole "is a square a type of rectangle, or is a rectangle a type of square" question seems like an unnecessary debate.