Hacker News new | ask | show | jobs
by tryfinally 700 days ago
> Oh yeah and if the interface removed a method and you didn’t realise you might be dragging that useless methods for a long while. Then again it’s not like your Java-style interface is any different.

In C# I usually use explicit interface implementations. (They're inconvenient to type, but Rider has a macro for it.) When the interface changes or disappears, my code won't compile.

1 comments

Didn’t know that existed. It’s a bit of a half assed version of half of type classes but it’s an improvement that this is at least available.

Can you also implement interfaces on types you didn’t define?