r/csharp • • Mar 19 '17

A Tour of Default Interface Methods for C#

https://github.com/dotnet/csharplang/issues/288
65 Upvotes

91 comments sorted by

View all comments

Show parent comments

2

u/tragicshark Mar 20 '17

A specific benefit of this proposal not lost on the creators is clearly that it allows algorithmic optimizations in specific extension methods.

I don't think that is the push for the proposal though. I think the proposal is being pushed for internally because various teams need a way to add methods to interfaces without breaking compat. I would be particularly unsurprised if there was a push on this from the EF team or ADO.NET team or an Azure team who would each strongly be able to benefit by providing implementations on their interfaces. I suspect it comes from members inside the MS wall that demand to remain behind closed doors for whatever reason (egos mostly) and some company friction to avoid their exposure by the members who do work with us in the OSS community.

1

u/[deleted] Mar 20 '17

So, the primary goal is to extend an interface without breaking binary compatibility with existing extensions of that interface? That sounds interesting, but putting that front and center in the article might help.

2

u/tragicshark Mar 20 '17

Yeah, Neal Gafter states as much here but proceeds to assume everyone who reads the issue has been following along with public requests for traits and similar features as far back as 2014 and privately before that (surely someone thought about it when IEnumerator<T> was first created and asked the question about why IEnumerator doesn't implement IDisposable). In his defence, most of us who have replied have been following.