4 ms·
I think they mean something like abstract base classes. It's tempting to design a class hierarchy from first principles: everything in the game is an entity, f
by mattkrause 7y ago
I think they mean something like abstract base classes.
It's tempting to design a class hierarchy from first principles: everything in the game is an entity, from which players and NPCs are derived. The NPC base class has several derived versions (allies, monsters); the monster class is specialized into animals and dragons, which in turn....
You can often paint yourself into a corner this way, where you suddenly don't want the dragon class to reuse part of the MonsterBase. They're suggesting making the classes stand-alone with duplicated code, at least until you figure out what these classes actually have in common and what is incidental overlap.
- floriol 7y agoThat's why designing the actual program is important. Also, static and strong typing for powerful refactoring plus extensive tests, and you can refact that Dragon class into something new. And while I do agree with you, I think it is not OOP that's bad but the programmer doesn't understand when to do inheritence vs composition etc