2 ms·
Virtual functions are helpful only when you have derivation and need some common interface. When your class is not meant to be derived from, declaring functions
by tspiteri 17y ago
Virtual functions are helpful only when you have derivation and need some common interface. When your class is not meant to be derived from, declaring functions as virtual is just plain misleading. And I am strongly against fitting everything artificially into a class hierarchy, that is, I dislike using the OOP sledgehammer for every simple class.
Also, great C++ programmers are those who use C++ in a problem domain matched to it, not those who use C++ where Perl or Python or something else is so much better. So they know that C++ is not archaic at all, it is just not suitable for every job, but then, what language is?