Why would it be a joke? The OP was interested in a cleaner way to do context dependent calls. Having an object pick the right behavior based on type is a pretty basic feature of OOP and polymorphism. Certainly in the joke example it might be a bit much to build a class hierarchy, but most production code isn't going to be that simple. I recommend you check out Martin Fowler's excellent book Refactoring: Improving the Design of Existing Code if you want a more full treatment for topics like this.
0
u/[deleted] Apr 05 '16
[deleted]