Generic interfaces: When to Use Them - podcast episode cover

Generic interfaces: When to Use Them

Feb 02, 202612 min
--:--
--:--
Download Metacast podcast app
Listen to this episode in Metacast mobile app
Don't just listen to podcasts. Learn from them with transcripts, summaries, and chapters for every episode. Skim, search, and bookmark insights. Learn more

Episode description

This story was originally published on HackerNoon at: https://hackernoon.com/generic-interfaces-when-to-use-them.
In this post, we’ll discuss the use of interfaces with type parameters in a couple of common scenarios.
Check more stories related to programming at: https://hackernoon.com/c/programming. You can also check exclusive content about #go, #golang, #generic-interfaces, #go-interfaces, #go-tutorial, #go-guide, #go-type-sets, #hackernoon-top-story, and more.

This story was written by: @Go. Learn more about this writer by checking @Go's about page, and for more stories, please visit hackernoon.com.

As interfaces are types themselves, they too can have type parameters. This idea proves to be surprisingly powerful when it comes to expressing constraints on generic functions and types. In this post, we’ll demonstrate the use of interfaces with type parameters in a couple of common scenarios.

For the best experience, listen in Metacast app for iOS or Android