Seems fairly standard stuff for libraries to consider. I was really hoping for some weird stuff like patching bytecode or implementing entire different languages as a python library.
I briefly thought "oh yeah, mixins, shame we can't do that in C# with single inheritance" and then realized that's what extension methods are for (and slightly more general).
I have some C# code which relies on calling an extension method on a null instance, which is mildly naughty but saves a lot of refactoring.
What a fantastic read. It’s nothing groundbreaking, but it’s a perfect model of how to learn good patterns.
thanks for resharing, interesting well written read
previous: https://news.ycombinator.com/item?id=32528919
Seems fairly standard stuff for libraries to consider. I was really hoping for some weird stuff like patching bytecode or implementing entire different languages as a python library.
Sure, but "Do not deprive people the joy of discovery." -Someone, not me.
I briefly thought "oh yeah, mixins, shame we can't do that in C# with single inheritance" and then realized that's what extension methods are for (and slightly more general).
I have some C# code which relies on calling an extension method on a null instance, which is mildly naughty but saves a lot of refactoring.