Containers for data, which was the main issue in the program he wrote. - Preventing the usage of global variables.
With that, I'd rather point towards
std::vector,
std::map, etc. and explain that one can wrap things into classes; a polymorphic hierarchy isn't needed for a basic game.
EDIT: Also, polymorphism is the base of object oriented programming, so saying:
it's a better code design to avoid polymorphism where ever possible
would be saying to avoid O.O.P., would it not?
Yes and no. OOP is an paradigm like many others and C++ is a multi-paradigm language, so sticking to one paradigm only, will not only produce bad code, but make life very hard. The modern C++ approach is to use objects, but reduce any dependencies between objects, while preferring composition over inheritance. That said polymorphism is not an "evil" thing over all, it has his places, e.g. SFML makes use of it for
sf::Drawable and
sf::Transformable, but as Laurent has mentioned a few times, he'd rather not have those "base classes".
As for game development specifically, the whole inheriting entity blob approach is not that much appreciated anymore, because it always introduces a highly depended hierarchy, which turns into less efficient code and makes it nearly impossible to maintain properly at some point. Better approaches are component based or data-driven systems.
Programming is much more than polymorphism and debugging, but we are not talking about the definition of programming; we are talking about good programming structure and efficient, effective code. My example also showed pointer, abstract class, and inheritance usage. Not only that, but the usage of a class to store functions and variables in general.
Well that's the problem, polymorphism isn't very efficient, since for example, every polymorphic structure will get compiled via a v-table, which aren't very efficient.
The whole point being made by me, is that the example is too complicated for a beginner. If he has never worked with classes, he will have no idea what inheritance is and will have no idea, how this point thingy now suddenly works etc. He's missing the basic of C++, which is what a class is and talking about polymorphism is a topic, he might want to checkout later on, thus my questioning of the relevance of your post.
But well everyone is free to post here.
PS: Please, please, please don't put dots between acronyms, it's just not the way to go, i.e. S.F.M.L or O.O.P. or A.P.I., it's SFML, OOP and API - thanks!