5 ms·
I think they solved the problem by not supporting multiple inheritance, instead supporting interfaces and/or traits. But also "composition over inheritance" pre
by lyu07282 2y ago
I think they solved the problem by not supporting multiple inheritance, instead supporting interfaces and/or traits. But also "composition over inheritance" pretty much won, thankfully imho.
- hakanderyal 2y agoMixins via inheritance is a sweet pattern that I miss in C# sometimes.
- mastry 2y agoC# has default interface implementations now, that can be used to create mixins... https://learn.microsoft.com/en-us/dotnet/csharp/advanced-topics/interface-implementation/mixins-with-default-interface-methods https://learn.microsoft.com/en-us/dotnet/csharp/advanced-top...
- hakanderyal 2y agoYeah I sometimes use them but they don’t cover all the cases. I’m waiting for roles/extensions to see if I can achieve a similar result. https://github.com/dotnet/csharplang/discussions/5496 https://github.com/dotnet/csharplang/discussions/5496
- LAC-Tech 2y agohttps://en.wikipedia.org/wiki/Multiple_inheritance#Mitigation https://en.wikipedia.org/wiki/Multiple_inheritance#Mitigatio... CLOS and Ocaml figured it out
- freilanzer 2y agoWhen in doubt look to CLOS.