Bah, C++ is most definitly the weirdest programming language ever invented. I think I’ll refer to it as “Object Oriented Assembly” in the future? Why? Because every little itzi-bitzi detail has to be declared rigorously. First of all, methods are non-virtual by default, this is common knowledge, however it’s totally annoying. Why would someone ever want to have a non-virtual method? Oh, of course, from a performance perspective it’s surely better for the compiler to know what’s virtual and what’s not. From a performance perspective one should propably use assembly, pfft.

Of course this is only one thing. Today I encountered another, … well, propably “feature” of C++:
class Clip
{
virtual void trimA( int64_t trim );
inline int64_t trimA() { return m_trimA; }
};

So if I derive from Clip and overwrite “void trimA(int64_t)” then “int64_t trimA()” is apearently “hidden” and cannot be called on an instance of DerivedClip. However, thanks to the gods of C++, they implemented some sort of workaround for that misfeature.

class Clip
{
using Clip::trimA;
virtual void trimA( int64_t trim );
inline int64_t trimA() { return m_trimA; }
};

Everybody likes C++.

-Richard

PS.: thanks to the fine people at mrunix.de and the C++ FAQ Lite for enlightening me on this topic.

PPS.: check out D, it sucks less.

Tags Development, Rant, Geek Documents

No Responses to “Object Oriented Assembler”

  1. Sam Says:

    I’m learning OOP for school. At the very start it’s strange… :razz:
    The demo-movie looks nice.

Leave a Reply

*
To prove that you're not a bot, enter this code
Anti-Spam Image