Hacker News new | past | comments | ask | show | jobs | submit login

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.



I still find it funny that somehow the idea of runtime function dispatch via function pointer is called the "strategy" pattern.


Hey I didn’t name it!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: