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

> constant pain with reading and debugging C++ templates

C++ templates are a nightmare agreed. What C++ does is just one way, a poor way, to implement generics. Please do not conflate generics with C++. If you've ever worked with C#, Java, TypeScript, or others you'll know that "generics" come in many different flavors. Some are quite nice. Generics are coming to Go ([https://www.gophercon.com/agenda/session/233094]).

Slices, chans, maps, arrays are all generic in Go - and they are great! Stuff like the sync package (https://golang.org/pkg/sync/) with interface{} all over? Not so great. Generics solves a real problem.



It would be great if generics could be used by a small team of professional Go developers who clearly understand strong and weak sides of generics. Unfortunately this is impossible in real world :( I predict that generics in Go will lead to much more poorly written hard to read and debug packages and apps.




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

Search: