Wednesday, September 20, 2006

I love virtual functions

Pure Virtual functions are even better - allowing you to force a child class to implement a particular function.

Imagine my surprise when I found this brand new type of pure virtual function:
long TSomeClass::SomeFunction()
{
// This is pure virtual
return 0;
}

The header of this class was even correct.
    virtual long SomeFunction() = 0;

Now, you may laugh at me - at my nerdish geekiness, but when I saw this, I started laughing out loud and had to print it off and show the other programmers in the office.

In fact, it was this snippet that caused me to start this blog.

So, there you go... let's laugh at this code, but most of all, let's laugh at the original programmer... you know who you are.

0 Comments:

Post a Comment

<< Home