Wednesday, January 6, 2010

*Slap *Slap

From Effective C++, by Scott Meyers :

"Anytime you find yourself writing code of the form "if the object is of type T1, then do something, but if it's of type T2, then do something else," slap yourself.

solution : overriding the method

No comments:

Post a Comment