2 ms·
> The art of turning 6 lines into 92 lines by replacing if-then-else and switch with objects.. > ..In summary, traditional branching is often a student’s tool
by lioeters 6y ago
> The art of turning 6 lines into 92 lines by replacing if-then-else and switch with objects..
> ..In summary, traditional branching is often a student’s tool until a more suitable, polymorphic approach is discovered.
I can't tell if this is serious or a straight-faced joke. The article did not convince me at all - in fact it dissuaded me further from the kind of approach taken, which I often encounter in the wild: a class for every condition, with slightly differing implementations.
A similarly questionable article was posted a couple days ago:
Anti-IF Framework - https://blog.arkency.com/anti-if-framework---if-slash-else-based-on-type/ https://blog.arkency.com/anti-if-framework---if-slash-else-b...