Hacker News new | past | comments | ask | show | jobs | submit login

The reason there are no generics in Go is because nobody has implemented them in Go (or presented a concrete proposal for implementing them, i.e. something less vague than "just do what C# did" while ignoring that C# is not AOT compiled). Thre are some monomorphizing preprocessors but they tend to punt on the interaction betweeen generics and the rest of the language.

I find the community's insistence that Go does not have them because they somehow make programming worse to be fairly ludicrous, when there are much more practical reasons. Obviously you can write useful code without generics (C does not have them), but that does not make them useless, or "cruft", or an undesired feature (unless you simply choose to believe that every single person complaining about them does not use Go): you can also write useful code without many other features that Go does have.




> while ignoring that C# is not AOT compiled

https://msdn.microsoft.com/en-us/vstudio/dotnetnative.aspx


Does this take significantly longer to compile than regular C# code (I can't imagine the answer is no)? If so, it doesn't really address the concerns Go's implementors brought up, which precisely revolved around the compile time : runtime performance tradeoffs that the JIT compiler helps mitigate for C#'s generics.




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

Search: