Skip to content

Comment on Should Go 2.0 support generics?parent

Comments

so, they're asking people who didn't use go because of generics to provide experience reports on the specific kind of problems they encountered when writing go ???

I write or use generic code in every single of my projects. i don't need to start coding in go ( which i did) to understand what i'll miss. i did my share of void* casting in C and i know how much it sucks.

This is an old problem. Everybody knows what the use is and what the benefits are. They tried to show the world that they were wrong and they failed to convince that people could get away without this feature. Now all they need is to get over it and start implementing something to fill that gap.

They are asking people who extensively use Go to help collecting cases where generics would be useful in the context of real world Go programs. So instead of cargo-culting a random generics design from a different language or some theoretical reasoning, they want to make sure to enhance the language in a way that actually solve real-world problems in programs written in Go.

Wouldn't it imply that they're happy with the current audience of the language, and don't wish to extend it ?

nothing wrong with that, though.

Wouldn't it imply that they're happy with the current audience of the language, and don't wish to extend it ?

You're assuming that people who have some degree of interest in generics and aren't Go users right now will somehow and for some reason decide to avoid Go just because it lacks generics.

It's a silly assumption.

well not really. I'm saying it could be interesting to ask people that decided not to use go , the reason they choose not to, in order to expand their user base.

well not really. I'm saying it could be interesting to ask people that decided not to use go

You're assuming that these people have anything relevant to say, particularly as they present irrational arguments to justify their fatwa on a programming language.

Meanwhile, those who are interested in exploring the language and are interested in putting it to work aren't wasting their time with irrational stances on a minor technical detail.

I use Go quite a lot, and I agree with their "irrational arguments". It seems quite dishonest to pretend that anyone who doesn't use Go because they found it too restrictive to be "wasting their time with irrational stances". It's also quite close-minded.

You're right that most Go developers aren't going to go out of their way to write a 5-page dissertation about how generics would help solve a problem they worked around, but that's not a justification for not including generics. The fact you have to write orders of magnitude more code in order to work around a lack of generics is ridiculous, and I find it frustrating every time I have to do it. Will I eventually crack and write a series of blog posts that just rant about every single fucking problem I have with Go? Maybe. But it seems quite unreasonable to only want reviews which effectively must be of the form of a coherent rant.

To offer a counter point: I dislike the idea of "I write generic code". I say this because it is one of the prime calling-cards of the over-abstraction, which IMO is one of the biggest (and most harmful) self-inflicted injuries in programming right now.

Honestly, IMO, 9 times out of 10 the places that developers use templated-types in order to "write generic code", it is an over-abstraction. The generics end up adding nothing but source-code complexity. I often wonder if the only reason generics get used in some situations is because the standard lib uses them.

end-user code probably doesn't need generic. The issue is much more relevant for librairie and framework developpers though.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.