No need to know your base class name. __super !
A question I love asking interviewees is: If you could fix one weakness of C++, what would it be ?
Pretty interesting to see how deeply a candidate thought about the language and its implementation.
My answer if I were asked the question is: I'd add a baseclass keyword. It would allow calling a base class member without having to explicitely specify its name. That way, one can more easily inject a small class in a hierarchy chain.
There's a trick to workaround that though: #define or typedef the base class. That way, you only have to change the #define/typedef when you inject a class.
Today, thanks to Raymond Chen, I learned that the Microsofties shared the same dream. And they made it come true: __super !
Just one more question Raymond: Why didn't you tell me 10 years ago !


2 Comments:
I see that your link for __super on MSDN takes me to " Embedded Operating System Development" section.
So, it must mean that appTranslator supports WinCE now? Cool! (smug)
Nice little keyword, though!
appTranslator does indeed support WinCE !
BTW, am i the only one who's too often driven to WinCE's help when typing an API name for a Win32 API ? :-)
Post a Comment
<< Home