4 ms·
I haven't delved into Go, can anyone vouch for how difficult/painful it is to do simple tasks such as array manipulation? Does it bother you? I've heard that it
by systemvoltage 6y ago
I haven't delved into Go, can anyone vouch for how difficult/painful it is to do simple tasks such as array manipulation? Does it bother you? I've heard that it is rather quite verbose and there should be some easy encapsulations for basic array manipulation, but Go offers no such convenience. What is the shoot-yourself-in-the-foot-ability of Go? As an outsider, Go appears to be C+Python combination but more like C and less like Python. How does it compare to Python+Flask or Ruby on Rails type of frameworks to build web services? I want to give it a try at some point.
- lanstin 6y agoIt is slightly more verbose than well written Python. I think that puts it a good 5x less verbose than the equivalent Java, tho I have not ported any Java to Go so YMMV. It is like Python in that it is modern, has a rich set of good libraries to do stuff, a simple method of codes reuse (interfaces rather than dynamic duck typing). You have first class functions so you can write cool call back based Jason transformers or the like. Ten liner Python reformatter is twenty in Go. Still clever and way faster and runs on sixteen or 32 cores with no work, assuming you design the program with the data flow in mind. I have not written many web services, just one gRPC thing which was the typically slow first use of a new framework couple of days work. Mostly I write network shimmies, eg syslog to Kafka or NAT to squid, or else S3 bucket editing utilities.
- didibus 6y ago> It is like Python in that it is modern That's a funny bit, what is modern about Python? A 30 year old language that predates even Java?
- solidasparagus 6y agoThe ecosystem is extremely up-to-date and in many areas, among the most advanced languages. No one is leaving Python for a new backwards compatible language. The syntax, while technically old, is quite "modern" because a lot of other newer languages look similar (presumably because of cross-language influence).
- lanstin 6y agoYeah I haven’t had any new to me technology that I needed to integrate with where I couldn’t just get some Python lib to do the heavy lifting.
- deleted 6y ago[deleted]
- HereBeBeasties 6y agoIt depends greatly on the task. If it fits neatly into the built-in data structures or smells quite systemsy and C-like, it's probably fairly easy in Go. String and array manipulation are similarly painful to C. The lack of generics can be a massive pain in the neck, meaning you end up copy/pasting things, and other people's code doesn't tend to be very easily extensible without actually editing it to add the appropriate interfaces or whatever. The lack of OO is sometimes fine, sometimes not. It's really not a very expressive language. (I appreciate that's a rather fluffy/vague thing to say, but I feel it's true.) On the other hand, you can cross-compile stuff trivially, you get nice self-contained binaries, it's generally sufficiently performant, and it's simple in the same kind of way C is, only with a garbage collector and easier threading (goroutines are pretty nice). There's no more ceremony really compared to something like Python+Flask, but the business logic you end up running behind your web API calls _may_ be a bit more verbose and feel clunkier. Or if you're lucky it may not. It's very much dependent on what exactly you're doing.