3 ms·
They probably will add generics at some point in the future. In the meantime, lots of people are using and enjoying the language as it is. If you want to write
by grey-area 13y ago
They probably will add generics at some point in the future. In the meantime, lots of people are using and enjoying the language as it is.
If you want to write generic methods using your own types, you can define an interface to operate on, and then create types which conform (or wrap more basic types to conform) - as this article demonstrates after it sets up a straw man to criticise golang with. I quite like that approach, though it does depend what sort of libraries you're writing, and what sort of types you're operating on - a maths library might be painful for example but if you're operating on your own types anyway, using interfaces is no great burden.
- coldtea 13y ago>In the meantime, lots of people are using and enjoying the language as it is. I hear that a lot. That's not really an argument. People also enjoy stupid things, including things that hurt them, like drugs.
- grey-area 13y agoI hear that a lot. That's not really an argument. Well, it certainly isn't a convincing argument that it is the best of all possible languages, but it does lend weight to it being worth a look in its current form. Personally, compared to other languages I've been forced to think in (Java, C, C++, ObjC, Ruby), it comes out favourably, but I'm quite happy to accept that some people might think it is stupid, dangerously simple etc, etc. and listen to their reasons why - there's room for more than one language in the world.