Proposal: Support for objects in switch statements
sarn
sarn at theartofmachinery.com
Tue Nov 7 23:54:55 UTC 2017
On Monday, 6 November 2017 at 10:10:29 UTC, Atila Neves wrote:
> Checking for types at runtime is a code smell in OOP. Sometimes
> necessary, especially if doing multiple dispatch, but never
> done gladly. There's already a way to dispatch on type: virtual
> functions.
>
> Atila
More on that:
https://www.tomdalling.com/blog/software-design/solid-class-design-the-liskov-substitution-principle/
It often happens when people try to model sum types using
polymorphism.
More information about the Digitalmars-d
mailing list