I definitely think there's a lot of merit to functional programming, and even in usage with go; but perhaps sparingly. Sparingly... meaning maybe it won't be the first thing I reach for when coding go 🤷🏽♂️. Due to its type system it's definitely a little bit harder to get more milage out of functional programming like python, javascript, haskell, elm, etc. But you're right perhaps we'll see an evolution of Go and its community and how we write go in the coming years (v2).
I usually regurgitate Uncle Bill's motto "optimize for correctness"
Here's a suggestion to reduce allocations for your mapForEach:
I definitely think there's a lot of merit to functional programming, and even in usage with
go
; but perhaps sparingly. Sparingly... meaning maybe it won't be the first thing I reach for when coding go 🤷🏽♂️. Due to its type system it's definitely a little bit harder to get more milage out of functional programming like python, javascript, haskell, elm, etc. But you're right perhaps we'll see an evolution of Go and its community and how we write go in the coming years (v2
).I usually regurgitate Uncle Bill's motto "optimize for correctness"
Here's a suggestion to reduce allocations for your
mapForEach
:Thanks. Nice catch. I wasn't focusing on performance as it was just sample code.
Gotcha!
I forgot to open my reply with:
First off... Thank you for sharing your findings and knowledge!