Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The lack of generics in Go is hugely over-hyped as a problem.

There are generic lists (slices & arrays), there are generic maps (dictionaries). You can build a hell of a lot on top of that.

To generalize logic, Go's interfaces are amazing.

There are some huge projects out there using Go, and not hurt by the lack of generics. Perhaps you've heard of Docker?

I work on Juju[1], a Go project that is over 200,000 lines of code. There's only a handful of places where generics would have made things a little easier, and it's never been "OMG this is so awful because we don't have generics".

And this is coming from a guy who spent his first 14 years programming in C++ and C#, so it's not like I'm not used to generics. You just write code in a different way. Sometimes you can't get around it when you need a containery class, so you use interface{} and cast the result, but that's the exception rather than the rule.

[1] http://juju.ubuntu.com



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: