In over a decade of driving, moving, and everything in between I have never needed a heavy duty truck like a Ford F-350, so clearly they aren’t useful and Ford should stop making them, right?
Oh construction workers might complain, but they could just use dump trucks to haul their heavy loads. And farmers might have issues, but they have tractors which could suffice. So what is the big deal? Let’s stop making those trucks!
Clearly this is an insane argument, so why is it constantly being used as a reason to end discussions about generics in Go?
Just because you don’t personally experience a problem doesn’t mean it is nonexistent.
There are many problems where generics would be useful.
Generics may not be the best solution, but they are better than anything that currently exists. This is where the discussion should start.
What are those problems?
What have people tried so far? Why has it failed or why would generics be better?
What other alternative solutions could we consider to solve the problem?
In other words, if you don’t agree with the addition of Generics in Go stop telling everyone, “I haven’t needed them in 3 years” and instead start reading the experience reports and helping people come up with solutions that don’t involve generics and aren’t a nightmare to maintain.
Sign up for my mailing list and I'll send you a FREE sample from my course - Web Development with Go. The sample includes 19 screencasts and the first few chapters from the book.
You will also receive emails from me about Go coding techniques, upcoming courses (including FREE ones), and course discounts.
Jon Calhoun is a full stack web developer who teaches about Go, web development, algorithms, and anything programming. If you haven't already, you should totally check out his Go courses.
Previously, Jon worked at several statups including co-founding EasyPost, a shipping API used by several fortune 500 companies. Prior to that Jon worked at Google, competed at world finals in programming competitions, and has been programming since he was a child.
Spread the word
Did you find this page helpful? Let others know about it!
Sharing helps me continue to create both free and premium Go resources.
Want to discuss the article?
©2018 Jonathan Calhoun. All rights reserved.