Hacker News new | ask | show | jobs
by jopsen 3146 days ago
Yeah, I wish go had more functional stuff, like .map(), .filter(), etc.

On the other hand I enjoy that when I pickup a package someone wrote there is not a bunch of different meta-programming using templates.

Generics sometimes lead people (including myself) to over-engineer solutions... usually because we want as much compile safety as possible. But at what cost in complexity.

1 comments

I'd rather read x.filter().map() than read the loops someone had to expand them into by hand.
I groan every time I have to implement the 15th type-specific loop implementation of what I'd do with a single map or fold in Ruby/Elm/Haskell/JS/TS/Crystal/every other language I use. It's not a lot of effort but it's a lot of mess and cruft.
Check out goderive
linking this for you: https://github.com/awalterschulze/goderive

i wish i could laugh, but i can't. the lengths people will go to work within such an impoverished language, and by means so antithetical to the go philosophy.