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

Stick close to the standard library and the extended libraries (https://pkg.go.dev/golang.org/x ), track a community list where a lot of discussion will be occurring very quickly after release.

I don't want to recommend "don't use generics", but generally think about whether or not you can solve the problem without them without immediately reaching for them. There are patterns in Go that work just fine today, which is why despite the fact that clearly some people are just flabberghasted at the idea that Go is useful without generics, it demonstrably is. Interfaces are quite a lot of what you need out of "generics". Don't just give up and copy and paste; it is necessary way less than some people who were trying to write C++ in Go claim it is.



this. Interfaces do 90% of what generics are used for in other languages. The remaining 10% had been solved by boilerplate/generation. Yes, it will be nice to have a better answer for that 10%. But we'll probably end up with generics being used (badly) for 90% of cases instead.

As always in Go, follow the standard library. If they're hesitating to use generics, then that's solid advice.




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

Search: