Get the latest tech news

C# almost has implicit interfaces


(almost) has implicit interfaces Background: I move between Go and C# a lot, and like to compare them Go has implicit interfaces, which means that a type implements an interface iff it satisfies that interface. It’s not declared.

It’s simply something that the type system determines to be true or false, as needed. There is an idiom in Go for making such declarations explcit, if only to signal intent and avoid regressions. For example, C#’s Stream and StreamReader have identical Read methods – but no Reader interface declared.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of implicit interfaces

implicit interfaces