5 ms·
I like C but strongly dislike Go. They share nothing other than having a small(ish) feature set.
by Lariscus 6y ago
I like C but strongly dislike Go. They share nothing other than having a small(ish) feature set.
- BoorishBears 6y agoI agree. Go feels like it's aimed at creating applications that run at a level above where C traditionally runs while keeping the pared down feature set of C, and it just doesn't work well imo. I loved playing with Go, but eventually it feels like you're conditioning yourself to be ok with a lot of "bad" code. Tons of repetition, tons of boilerplate by other names. It's like the simplicity gets in the way of itself. - My take is, use Go for a bit, take the "less is more" mentality with you to a language more suited for real work. ps: I'm not saying you can't use Go for real work before someone flies at me. I'm just saying that Go's strength is the mentality people have when using it, as a language it's not particularly enabling, and that's by design if anything...
- bak3y 6y agoMeanwhile the place I work writes all microservices in go and all of my team's (DevOps) tools are also written in go...
- BoorishBears 6y agoI explicitly added the "ps" to avoid the situation where all the replies are fairly empty comment saying "Well we use it!" I get that you can use it for real work, I'm not saying you can't. I'm saying, even by design to some degree, it's not particularly enabling compared to other languages. That's meant to be a strength if anything, but I did not find the tradeoff of simplicity was able to overcome the additional effort it took to deal with what was missing There's an implicit ymmv here of course, because I'm not saying no one can find Go useful, I can see how in certain worlds with certain teams with certain priorities it'd all work out. It's just not for me.
- murukesh_s 6y agoI have used Go in production. I found it roughly takes 2-3x additional time it takes to develop the same functionality in Node.js (with typescript). But it runs faster. If you want to write code that is probably not going to be thrown away it may be wise to invest the additional time in Go. However can't recommend that for building experimental code/APIs etc which are time bound and may/can get replaced (or split into micro services) in future if it becomes massively successful..
- AlchemistCamp 6y agoAnd that's saying something give that neither Node nor TypeScript have ever had productivity as a main selling point! Imagine evaluating the time to market for an experimental back-end written in Rails, Laravel, Phoenix, etc vs Go! The difference is staggering.
- konart 6y ago>Rails, Laravel, Phoenix, etc vs Go! Comparing frameworks and a language, really?
- AlchemistCamp 6y agoAbsolutely! There are obvious productivity differences between the languages themselves and frameworks can make it even more apparent. Different languages make writing the DSLs used in Rails-like frameworks easy, difficult or impossible. Much of my professional career was spent working on Node back-ends with a variety of frameworks and none of them were even close in terms of succinctness or productivity.
- murukesh_s 6y agoAgree with that. However none of the frameworks comes closer to visual programming environments (nowadays called low code).
- 6y ago
- AlchemistCamp 6y agoGo can be nice for simple domains where performance is very important. In most cases like that, I'd use Rust, though.
- Thaxll 6y agoThe last couple of years are showing that Go delivers, it's pretty easy to find dozen of "real" software written in Go that are weidly used.
- BoorishBears 6y agoSometimes I don't know why I bother talking about Go. It's proponents are so quick to go defensive that no one is capable of reading any complaint in an even mildly charitable light. I mean I shouldn't literally have to say "I'm not saying you can't use Go for real work before someone flies at me." When talking about a language as widely used as Go right? Like that's common sense! And yet of course I'm getting replies that do exactly that because of how darn defensive people need to be about it.
- Thaxll 6y agoMaybe don't use things like " to a language more suited for real work."
- BoorishBears 6y agoThere is a literal full paragraph dedicated to explaining it, maybe don't ignore the oodles of context I left to avoid exactly what you did. Saying other languages are more suited to real work doesn't mean Go isn't suited at all, it literally means other languages are more angled towards the "end product" or the "real meat and potatoes" of just making a thing work than Go. It's literally a strength of Go. Go doesn't want to include the kitchen sink or even confine you to having a kitchen at all and I respect that. But I'm saying that other languages that include more in the way of affordances can help one be more productive, and I believe combining a language that includes more, with the mindset of not abusing the buffet is a winning combination. Ymmv, I'm not an oracle, I just expect people to read things in a reasonably charitable way which usually works fine as long as they're not being defensive.
- steve_adams_86 6y agoI agree about becoming okay with bad code. But I think if you understand and embrace that, there’s a place for it and it can be quite powerful and easy to use at times. It’s a trade off that makes sense sometimes. I think the problem appears when people treat Go like it doesn’t have any problems. All languages do. As I’ve mentioned recently though, I don’t think I’d ever want to use Go as a forever solution to a complex problem. I’m sure some people could do it and do a great job, but I’m not one of those people. I need the ability to abstract and ensure more safety, or I’ll never feel secure with what I’m building.
- blablabla123 6y ago> I loved playing with Go, but eventually it feels like you're conditioning yourself to be ok with a lot of "bad" code. Tons of repetition, tons of boilerplate by other names. Not well or hastily written Go is easily like that. I can only guess why you point out the repetition but when you look at well written Go code like in the Go std library, there isn't much repetition happening and it looks rather elegant. At the same time it can be quite some effort to create such code and might take several iterations. Documentation-wise I like the official documentation, it gives a lot of pointers why Go is how it is. Also obviously it's not for every use-case. Where it works really well IMHO is where error handling is a vital part of the application. (And of course anything concurrent is quite a breeze)
- BoorishBears 6y agoNot having generics, by definition, invites a lot of repetition and boiler plate. I know generics are overrated and coming soon, but right off the bat that stuck out. I recall a point where I had written a function that needed to return a channel, but of course had to forgo types due to the lack of generics. The end result was having to wrap that channel in another channel that added typing at each call site. I asked around in go circles if that made sense, and called out how bad the felt but the answer was "no that's great! channels are cheap! the repetition is good because it's simple!" - The error handling has some sore points to that end too, and the implicit shadowing with shorthand assignments on one hand makes it easier to deal with multiple errors, but on the other hand introduced subtle logic bugs on one than more occasion where "err" was silently shadowed, which I greatly disliked. I'm actually suprised Go didn't forgo shadowing for the shorthand operator and force people to label their errors when dealing with multiple, it seems very "in brand", but I guess even Go draws the line somewhere lol - Then there's the whole stack trace situation. Which after plenty of reading still just wasn't making sense. I mean the idea of logging a stack of wrapped messages sounds very nice, but man proper stack traces not being the first class citizen of error handling just did not make sense to me in a language I hear referenced for systems work so much (and I realize they can be had) I saw proposals to rework Go's error handling, I don't know if any progress has been made to that end, but it's another example where simplicity can get in the way of itself - And I'll balance this all out by saying it was still fun to write, I don't want to seem like I'm just shitting on Go for existing. It's just these little warts that I kept getting over with just a little bit of "idiomatic Go" which I often found was just writing a little bit more code than you're used to, started to add up. And eventually I realized I was creating something that, while very easy to reason about, had a lot more to reason about than it needed to. That's where I kind of petered out in my personal usage.
- skrtskrt 6y agoI will take sometimes-tedious boilerplate over many-many-layered abstractions. You can write any language any which way, but some languages just have a culture of boilerplate vs abstractions. The most popular Python and Java libraries seem to love endless layers of indirection, and when it doesn't fit exactly what you need, you bang your head against the wall monkeypatching it to make it work since your whole app is already written in X mega library. Go culture seems to be quite a bit more boilerplate-y and uses smaller more composable libraries. It's just refreshing. Really I just need to buckle down on Rust, but I think it's a fair bet that teams and shops that bring in a lot of young programmers and want to ramp them up fast may cringe a bit at the learning curve of Rust. That's why for now in terms of a bet on employability, I am prioritizing experience with Go.
- 37ef_ced3 6y agoTake Go's slices, for example Realize a Go []int ("slice of int") is just a C struct like this, passed by value: struct intSlice { int* addr; int len; int cap; }; The memory at addr is not owned by the slice. All the slice operations are simply notation for manipulating the struct. Go's garbage collection makes the whole thing work well This can be confusing if you're used to C++'s std::vector (which owns the memory) or Python's slices. Go's slices are a shallow pointer/length system exactly like is used in C all the time. For example: void sort(int* addr, int len); becomes func sort(a []int) A Go slice is just a formalization of C's pointer/length idiom, with terse notation for manipulation
- traes 6y agoI'm not really sure saying that features in Go can be modeled in C really suggests that they are similar as languages. Syntax is very important.
- nyanpasu64 6y agoGo's slices don't act like what I thought were called "non-owning references"(Rust's &/&mut [T] or C++'s std::span<T/T const>), which reference memory whose lifetime is bounded by something else (like a vector or array or shared pointer). Instead it's "shared ownership" where memory is referenced by one or more slices (and no single owner) which can reference and mutate the slice simultaneously, and it's freed by the GC sometime after all the slices are gone. This reminds me of Numpy's ndarrays, which act more like "owning containers" (which may sometimes share ownership and alias) than "non-owning references".
- erik_seaberg 6y agoSlices are kind of a mess. They should either be uniqueness types or passed by reference (the way maps and channels are, and NIO buffers from Java). Instead they’re passed by value so multiple copies exist whose sizes and sometimes contents aren’t in sync.
- mhh__ 6y agoSlices should be the absolute bare minimum for a modern systems language, it's not really a reason to switch in my case If I want to write flat/simple code I'll just C, Go doesn't really offer anything to me because I want to be relatively low-level and able to make the compiler save my time.