Re:If Inheritance is so bad, why does everyone use it?
by sameoldtune on Thursday April 11, 2024 @02:50PM
(#40005482)
You’re describing the strategy pattern, which is probably one of the most practical coding design patterns. Ex: each chess AI difficulty gets its own class, which all extend a common interface.
[ Parent
| on HN ]
Re:If Inheritance is so bad, why does everyone use it?
by krapht on Thursday April 11, 2024 @03:44PM
(#40006030)
I still find it funny that somehow the idea of runtime function dispatch via function pointer is called the "strategy" pattern.
Re:If Inheritance is so bad, why does everyone use it?
by sameoldtune on Thursday April 11, 2024 @06:19PM
(#40007396)
Hey I didn’t name it!