3 ms·
The biggest advantage of C-style polymorphism vs, say, C++ is that it actually offers much better encapsulation. Having private methods declared in the header
by alex_smart 3y ago
The biggest advantage of C-style polymorphism vs, say, C++ is that it actually offers much better encapsulation.
Having private methods declared in the header file which is supposed to be the public contract for the class is such an anti-pattern. And the usual solutions offered for this problem are ugly in their own right (*pImpl).
I only properly learnt to appreciate the power and beauty of OOP by reading people’s C code.
- pjmlp 3y agoWhich C++ modules fix. Plus that same C pattern compiles in C++ without problems.