> hell no, if generics get into go I'll have to find another favorite language.
Well, I hope go get generics fast then. Seriously, what is this community that rejects any possible enhancement to a language? Even C gets new features albeit slowly. A language that doesn't evolve is a dead one.
There is nothing complicated with generics, they are just incomplete types, that's all. Generics =/= C++ templates.
Ada has a great implementation of generic programming which forces the developer to complete generic types before using them. In fact Ada got a lot of things that go got wrong despite being way older, especially when it comes to concurrency and types.
Package based generics make them completely compile time and runtime safe, no type erasure. The'd be the equivalent of reflect.MakeFunc or reflect.MakeStruct at compile time, so without any performance penality or ugly reflection, which go has right now.
I'm on the fence about generics...but to answer your question generally...it's not all 'enhancements', it's making a language less readable. Sure, I can choose never to use it. But now I have (more) trouble reading others code. Go's strength, to me, is readability.
Why? Like, I might have weird taste, because I really liked generics and even Java-style checked exceptions :-) And to me, generics always sounded like the most practical way to do safe code-reuse across various types.
They add complexity which makes understanding and auditing code much harder. Look at OpenSSL and their overuse of macros, or heavily-templated C++ code.
No one is asking for C/C++ style macros, or even C++ templates. Go generics would be closer to Java or C# generics, which increase code clarity, reduce boilerplate and copy/paste code, and communicate intent.
Yeah, I can see how having features added to your favorite language while remaining fully compatible with the code you write today would warrant such a reaction. I mean, just having them in your language, even if you don’t have to use them is just so horrible.
I think it would be naive to believe that adding generics to Go would have no effect on the stdlib, third party packages, and ultimately how you write Go code.
Well the same is true for multiple languages which will mean not everyone has to use Go. Especially when there are so many interesting languages to choose from.
Well, I hope go get generics fast then. Seriously, what is this community that rejects any possible enhancement to a language? Even C gets new features albeit slowly. A language that doesn't evolve is a dead one.
There is nothing complicated with generics, they are just incomplete types, that's all. Generics =/= C++ templates.
Ada has a great implementation of generic programming which forces the developer to complete generic types before using them. In fact Ada got a lot of things that go got wrong despite being way older, especially when it comes to concurrency and types.
Package based generics make them completely compile time and runtime safe, no type erasure. The'd be the equivalent of reflect.MakeFunc or reflect.MakeStruct at compile time, so without any performance penality or ugly reflection, which go has right now.