Re:Channels Are Not Enough
by swah on Monday September 15, 2014 @12:01PM
(#8319613)
I also find Go pragmatic but lacking abstraction power. The other day I needed a stack, and the best solution I could find was this:
https://groups.google.com/d/msg/golang-nuts/iwlzqNa4h3g/xCy3...
And that's what I'm using...
[ Parent
| on HN ]
It's 10 lines of very obvious code. Isn't that a good thing? Do you really need stack.New<T>()?
Yes, I do think so. Then I could keep thinking about the "business problem" instead of googling for half an hour because I can't believe there is no one reuses a stack in Go.
Also, it could be something much more complicated than a stack, like the data structures in the STL... but that point has already been made elsewhere.