DEV Community

Go Time

So do we like Generics or not?

So, do we like generics or not? Some people feared they’d be the end of the language. Others were very hopeful, and had clear use cases, and were thrilled about the feature coming to the language. It was also often touted as the reason a lot of people didn’t adopt Go. So what do we think now? Mat and Kris are joined by Roger Peppe and Bryan Boreham to discuss the state of Generics in Go.

Leave us a comment

Changelog++ members save 1 minute on this episode because they made the ads disappear. Join today!

Sponsors:

  • Fastly – Our bandwidth partner. Fastly powers fast, secure, and scalable digital experiences. Move beyond your content delivery network to their powerful edge cloud platform. Learn more at fastly.com
  • Fly.io – The home of Changelog.com — Deploy your apps and databases close to your users. In minutes you can run your Ruby, Go, Node, Deno, Python, or Elixir app (and databases!) all over the world. No ops required. Learn more at fly.io/changelog and check out the speedrun in their docs.
  • Typesense – Lightning fast, globally distributed Search-as-a-Service that runs in memory. You iterlly can’t get any faster!

Featuring:

Show Notes:

Something missing or broken? PRs welcome!

Timestamps:

(00:00) - It's Go Time!
(00:45) - Roger Peppe
(02:22) - Bryan Boreham
(02:57) - Overview of generics
(06:25) - [Square brackets]
(08:09) - Roger's generic use
(19:37) - Constraints
(26:45) - Proposal for type switching
(30:01) - The error interface
(30:51) - Roger's Qt project
(35:45) - How do generics make you feel?
(43:56) - Go 1.21
(47:18) - Maps package
(49:41) - Unpopular opinions
(50:01) - Mat's unpop
(50:45) - Roger's unpop
(59:25) - Bryan's unpop
(1:03:55) - Kris' unpop
(1:11:04) - Mat's 2nd unpop
(1:12:01) - When Mat called a guy homeless
(1:22:11) - Universal jokes
(1:26:59) - Outro

Episode source