A C++ codebase demonstrates two anti-patterns in object-oriented design: manually tracking derived class types in the base class using enums instead of leveraging polymorphism, and implementing base class methods that cast to derived classes using dynamic_cast. Both approaches require the base class to know about all derived
•3m read time• From thedailywtf.com
1 Comment
Sort: