3 ms·
There is no need for (implementation) inheritance just to use dynamic dispatch. Many languages provide mechanisms for dynamic dispatch without needing to use in
by jpr 16y ago
There is no need for (implementation) inheritance just to use dynamic dispatch. Many languages provide mechanisms for dynamic dispatch without needing to use inheritance.
Also, you can certainly have encapsulation even in pure C with proper use of header files and use of typedefs, though C in no way requires you to encapsulate anything. Ever wondered what is the FILE in FILE* that many C/Posix functions use? I certainly have. But it's not necessary to expose it to callers of functions that use it. So much for encapsulation and inheritance going hand in hand.