Hacker News new | ask | show | jobs
by ed25519FUUU 1990 days ago
I'm really mixed about this. As a developer I would love having generics in Go. I can think of a few places in my code I can greatly simplify if they were implemented now.

However, as someone who reads other people's Go code, I'm not a huge fan. One of the greatest things about Go is that a developer can usually one-shot read and understand almost anybody's code because there's a simplicity "forcing-function" applied to everything. To lose that would be a shame.

2 comments

parametric polymorphism does not make code harder to read

you know what's hard to read? hand-rolled for loops & select blocks combined to wrangle concurrency.

the no1 benefit of parametric polymorphism in Go is going to be abstracting over concurrency

Exactly. I found myself so frustrated when learning Go and digging into the "gotchas" of goroutines. There is so much non-obvious complexity that could be completely avoided by providing generics so that someone else can develop a package to handle the issues for you.
In other words, go is the language you want your coworkers to write, not the language you want to write. :)
I agree totally with this sentiment. I love reading other people's Go code but not always writing it, which is basically the opposite of virtually every other programming language I've used.
I’m reminded of “languages designed for the masses”: https://news.ycombinator.com/item?id=899246