Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yes. In particular, it means you can switch from depending on a concrete type (say, a whole S3Client) vs depending on just a much smaller interface (eg if you only want GetObject) without having to touch anyone else’s code. The compiler will still check that the types being assigned to the interface meet those constraints.


Sounds a lot like just using functions. I do that a lot if there is only a single function from a type I need. I’m yet to decide if that’s a mistake or not.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: