Skip to content

Comment on C# almost has implicit interfacesparent

Comments

It would be useful in testing, mocking (faking) sealed classes etc

You can do that with explicit implementations just fine e.g. haskell type classes (and their less competent sibling rust traits).

It is, if anything, better: you can abstract over multiple third party types, and you’re not stuck with the interface they defined, so if you need to switch in the future you can.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.