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 three chapters from the book, and over 2.5 hours of screencasts.
You will also receive notifications when I release new articles, along with other freebies that I only share with my mailing list.
Jon Calhoun is a full stack web developer who also teaches about Go, web development, algorithms, and anything programming related. He also consults for other companies who have development needs. (If you need some development work done, get in touch!)
Jon is a co-founder of EasyPost, a shipping API that many fortune 500 companies use to power their shipping infrastructure, and prior to founding EasyPost he worked at google as a software engineer.
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.