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

I'll be happy if generics will be never included in Go. They will definitely reduce code readability, will increase binary sizes and will increase compile times because of generics' abusers.

I wrote a ton of various code in Go [1] over the last 10 years and had never experienced the need in generics. The last my project in Go is VictoriaMetrics [2] - fast and cost-effective open source time series database and monitoring solution.

Before Go I was writing some code in C++ and was constantly struggling with C++ templates in stl and boost libraries. This was absolute nightmare from debugging PoV.

[1] https://github.com/valyala/

[2] https://github.com/VictoriaMetrics/VictoriaMetrics/




> I'll be happy if generics will be never included in Go. They will definitely reduce code readability, will increase binary sizes and will increase compile times because of generics' abusers.

Well you don't have to use them and you won't have to use any of the libraries that use them. Just like C++ templates, some C++ shops forbid their use. But that's your problem, don't make everybody else suffer from what is considered a burden and a flaw in that language.

People want compile time type safety, not having to resort to runtime reflection, which Go std lib itself does . There is nothing unfathomable about that thought process. Go has a poor type system at compile time while being way too permissive at runtime.


It would be great if you could provide practical examples where generics could significantly improve Go code.


> It would be great if you could provide practical examples where generics could significantly improve Go code.

It would be great if you stopped patronizing people who just provided you an explanation you just don't want to hear.




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

Search: