4 ms·
Go seems nice, but don’t you think writing business logic feels very tedious compared to C#? Generics and linq speed development time up for me significantly.
by Xeronate 6y ago
Go seems nice, but don’t you think writing business logic feels very tedious compared to C#? Generics and linq speed development time up for me significantly.
- cutler 6y agoI can't think of anything other than Java that's as tedious to write as C#/ASP.Net. With Java and C# code you spend a siginifcant amount of your time messing with the complexities of the language itself instead of dealing with your business problem. The mixture of generics and static typing is particularly pernicious. I really hope Go 2.0 doesn't end-up going down the generics rabbit hole.
- bschwindHN 6y agoI 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)
- Xeronate 6y agoCan you give some concrete examples of how C# is tedious compared to go? Things like var filtered = purchases.Where(x => x.Name.Contains("Sean")); and var grouped = purchases.GroupBy(x => x.Buyer).Where(x => x.ToList().Count > 10).ToDictionary(x => x.Buyer, x => x.ToList()); etc. come up a lot in day to day programming and always feel tedious to me in go. The first example in go looks something like filtered := []purchase{} for i := range purchases { if purchases[i].buyer == "Sean" { filtered = append(filtered, purchases[i]) } } and it only gets worse as the domain gets more complicated. I don't really know what your background is where you feel that static typing and generics are complicated. I write C# every day and spend 0% of my time fighting the language.
- 0x445442 6y agoSame experience here for Java. I always have a hard time understanding the arguments against it. The platform and tooling far exceed that of Go and I've never found the writing of actual code to be anywhere near the bottle neck in the entire development process. And while I've never worked professionally with C#/.NET, I imagine it's a very similar experience.