3 ms·
That's really misguided. Go is not a functional programming language, it's an imperative programming language. You're going against its design. You're like thes
by mseepgood 4y ago
That's really misguided. Go is not a functional programming language, it's an imperative programming language. You're going against its design. You're like these people who write Java and "class hierarchies" in Go, just from a different angle. If you like FP you should use Haskell instead of Go. I say this as a fan of Go.
- KingOfCoders 4y agoA map() is much easier to read and understand than create slice, for loop, return slice. Coding is about reading code.
- morelisp 4y agoAn unfused map-filter chain is a performance disaster waiting to happen.
- KingOfCoders 4y agoIn Go or in general? I've written code for companies with 50k+ concurrent writing users, I've bootstrapped and scaled and sold a startup on Scala (which has bad performance b/c of immutable lists but with usual list <100 elements no problem) and I haven't seen this in other languages, but I'm not experienced enough in Go and haven't deployed something major in Go yet.
- morelisp 4y agoOther popular languages will fuse either via JIT or via some kind of linear types. You should preen less in your comments.
- KingOfCoders 4y agoI think it's always easier to understand a point of view if you know where someone is coming from and the context. "An unfused map-filter chain is a performance disaster waiting to happen." Could you share your experience with that perfromance disaster here?
- Zababa 4y agoI don't think things are that simple. I like functional programming, but I also like good tooling, having a rich ecosystem, job opportunities, backward compatibility, simplicity, people to talk to. There are lots of things that can weigh on your choice of language. Semi-functional Go might be the sweet spot for some people, and absolute hell for others.