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

This issue has been addressed in the FAQ. They say generics might get added at some point, but they don't want to rush it. C# 1.0 didn't have generics either. http://golang.org/doc/go_faq.html#generics



I meant that if they use generics in some built-in classes, they should also give that possibility to users. If they cannot give it to users, they shouldn't use it in built-in classes. It feels like they think users are too dumb to implement their own, so they give some created by them.


Maybe they are afraid of introducing some features they would later regret. This is not a hobby project of some lone hacker, it's meant to compile Google's infrastructure.

I really don't see why user code has to have the same capabilities as the runtime. It looks more like a philosophical request than a practical one.


I believe you are letting your raw feelings get in the way of making technical assessments and decisions.


Should all languages also allow users to define flow control structures?

Yes, some languages do this, but there is (as almost always) a trade of between simplicity and flexibility.

I think Go strikes a very nice spot there.

In go the built in datastructures are very carefully selected, and are extremely useful, while when you need to build your own datastructures is both simple and powerful (you have direct control over memory layout), you just can't build magically generic datastructures, but that always comes at a cost, and Go's interfaces also provides ways to write generic code that are quite powerful.


Kind of like arrays in C or in pre generics Java and C#. Definitely not ideal but not that unusual either.


I'd argue that C# didn't become an interesting and enjoyable language until it gained generics.

Generics certainly aren't essential to a language, but once you're used to them it does feel a touch chafing not to have them, as well as it feel a touch strange for them not to be included in a new, statically typed, language. My opinion naturally...


It needs to be addressed in the code, too.




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

Search: