3 ms·
One big difference would be encapsulation. With mixins (sometimes called Concerns), you have a shared state between the module and the class including it. Wit
by bemurphy 14y ago
One big difference would be encapsulation.
With mixins (sometimes called Concerns), you have a shared state between the module and the class including it.
With a real class, you have your own space and (probably) don't have to deal with state and method collisions.
Pros/cons to each surely, and a lot is a matter of taste at that.