When should I favor extension methods over #Charp 8 default interface implementations?

When I have an extension method in the same assembly and namespace as the interface it extends, is there any reason to *NOT* use a default interface implementation on the interface instead?

#dotnet #APIDesign #FrameworkDesign #FrameworkDesignGuildlines
@bot

@bitbonk A default interface implementation would result in reflection seeing the method on the interface where it would not see the extension method.

I was going to say that one instance I can think of where this would have an impact is in list initialization, where the runtime detects an "Add" method with the required signature, but I have just read that the "Add" method can also be an extension method. I never knew that.

#dotnet #APIDesign #FrameworkDesign #FrameworkDesignGuidelines

@Josh_Gallagher Maybe one reason could be to keep the interface (which is usually an abstraction) simple and clean?

@Josh_Gallagher Anyway, I took it to #StackOverflow for a better discussion.
I hope the question doesn't get closed. Asking question "correctly" on SO has become a bit hard lately and often feels like a run of the gauntlet. 🙁

https://stackoverflow.com/questions/74535296/should-i-favor-default-interface-implementations-over-extension-methods

Should I favor default interface implementations over extension methods?

Default interface implementations of C# 8 and extension methods have in common that you can "add" a method with implementation to an interface. "Add" being in quotes here becaus...

Stack Overflow
@bitbonk I just looked at it and... closed!! At least you got some good comments on it, though.
@Josh_Gallagher OMG, I knew it! It is absolutely not worth it trying to ask questions on #StackOverflow. What an utterly frustrating experience.
@bitbonk Yeah, some of the mods are complete sticklers for there needing to be a "right" answer. You could try your luck on https://softwareengineering.stackexchange.com/
Software Engineering Stack Exchange

Q&A for professionals, academics, and students working within the systems development life cycle

Software Engineering Stack Exchange
@Josh_Gallagher Moved the question over here an included the feedback from the comments: https://softwareengineering.stackexchange.com/q/442413/11332
Should I favor default interface methods over extension methods?

Default interface methods of C# 8 and extension methods have in common that you can "add" a method with implementation to an interface. "Add" being in quotes here because for

Software Engineering Stack Exchange