Hacker News new | ask | show | jobs
by hwc 19 hours ago
On the other hand, I've found that for every real-world application I've written in Go, I have not found myself missing any of the containers C++ has had since 2003. I didn't really ever need generics either. I only use them to make it to make it clear which functions don't rely on specific properties of the type they operate on.

Yes, there are occasionally really good reasons to use an ordered map or a priority queue, but I haven't needed either in years.

1 comments

Most generics code is for library authors. Having generics allows you to write ergonomic algorithms for eg channels instead of forcing every single app developer to reinvent the wheel and run into the same footguns