3 ms·
Fair enough, there is no doubt you can have some sort of dynamic dispatch without inheritance. I'm more skeptical about your definition of OOP. That seems silly
by jonathanstrange 3y ago
Fair enough, there is no doubt you can have some sort of dynamic dispatch without inheritance. I'm more skeptical about your definition of OOP. That seems silly from a historical perspective, and they really shouldn't have taught you that at university. Historically, dynamic dispatch was invented and used for full-fledged OOP systems, so much that you'd expect from the feature "dynamic dispatch" the ability to determine an object's class at runtime and dispatch methods based on it. Smalltalk is a good example, it has full support for inheritance and exactly the kind of dynamic dispatch I described, like practically every other OOP language that has ever been invented. They merely differ in whether they allow single dynamic dispatch or have multiple dynamic dispatch like e.g. CLOS. As far as I know, Go's crippled version of structure composition without inheritance is fairly new, and, as much as I like Go, is a rather annoying and artificial limitation. Even modern Pascal has full OOP.