2 ms·
I have to agree with Xeronate on this one, a lack of generics makes writing business logic in Go quite annoying. Generics and the monad-esque values it enables
by bschwindHN 6y ago
I have to agree with Xeronate on this one, a lack of generics makes writing business logic in Go quite annoying. Generics and the monad-esque values it enables make it much easier to model your logic properly.
I like Go for services that just need to push bytes around to various places but otherwise it does get quite tedious for complex logic.
- Xeronate 6y agoWhat types of services don't have complex business logic? Just trying to expand my horizons. I guess like a video transcoding service or something like maybe.
- bschwindHN 6y agoSomething like a WebSocket server, a load balancer, message queue, that sort of thing. It's not that those aren't also complex, but there's less "business" in the logic, if that makes sense. Something that doesn't handle arbitrary user input or deal with the messiness of humans, like first/last names, dates and timezones, etc. As an example, I had once written a WebSocket server in go which took a program as input, ran it in a heavily stripped down docker container, and streamed the stdout back to the client. Go was perfect for that use case. (though to be honest I'd pick Rust now because I'm past the learning curve on it)