|
|
|
|
|
by fifilura
956 days ago
|
|
I am not a functional programming fanatic, but I do appreciate all the functional constructs making their way into less esoteric languages. Such as map/reduce and in general working with immutables. Golang does not have this and it makes me feel like programming with only one hand. In particular when working with data and aggregations. I am prepared to be corrected, I have only looked briefly at golang, so I am happy to give golang proponents a chance to shine! |
|
What I also found was that there was a whole class of errors that I hadn't seen in years due to mutable state and poorly written for loops/ranges when compared to map/filter/reduce usage.
We introduced `samber/lo`[1] which provides a lodash-like library, generics compatible, to Go. This has been a big step-up and has improved my experience with writing Go immeasurably.
My colleagues now (kindly) joke every time they see a PR from me that includes a lot of samber/lo usage that I'm slowly replacing every for loop I encounter.
[1]: https://github.com/samber/lo