5 ms·
I'm curious, what is painful about it? I came to Go from mainly C++, Java, and Python background, and I feel like it's the best of all 3 (to me). It's compiled
by 12298765 8y ago
I'm curious, what is painful about it?
I came to Go from mainly C++, Java, and Python background, and I feel like it's the best of all 3 (to me). It's compiled and really fast (like C++), it has a great set of libraries and community interaction/support (like Java), and it has simple syntax that is clear and quick to understand (like Python).
It's not a perfect language (nothing can ever be), but it's become my favorite to use for back-end web services and even taken over some of my scripting workflow.
I can see it being painful if you're trying to render websites server-side though. That's a bit outside of what it's made for
- sam0x17 8y agoIn all honesty, indenting with more than 2 spaces (or, gasp, with tabs) is enough to kill a language for me these days. There are so many competing "new age systems languages" as I call them (crystal/rust/go/nim/d/julia/etc) that you really can pick the one that suits you the most. Crystal is more my speed. Yes go is way more mature, and has all the features I want, but it just isn't set up how I want things to be set up, whereas Crystal is. Is Crystal perfect? No, but it's the closest thing to what I want, and has all the appearances, trappings, etc., that I would expect of a language sent by the gods. The way go code looks just doesn't do that for me, but I'm sure it does for the people who created it.
- sam0x17 8y agoOn the topic of web frameworks, though, I firmly believe it is possible to write a delightful web framework with mass appeal (like Rails) in any language, you just need the right influences and conventions, but this seldom happens because the people who could write it are already busy enjoying their framework in the language that they enjoy most.
- oconnor663 8y agoPersonally I found it too easy to accidentally forget to check an error, or to shadow a named error return, or to create a nil error that doesn't compare equal to nil. Also to write a method that appears to mutate the receiver but which in fact copies it.
- agnivade 8y ago> I found it too easy to accidentally forget to check an error Use https://github.com/kisielk/errcheck https://github.com/kisielk/errcheck for that. Or prefer https://staticcheck.io/ https://staticcheck.io/ for a larger set of checks.
- apta 8y agofmt.Println("foo") I don't see errcheck complaining there how about (taken from here: (https://www.reddit.com/r/programming/comments/ak305l/goodbye_world_the_perils_of_relying_on_output/ef28swk/ https://www.reddit.com/r/programming/comments/ak305l/goodbye...): r1, err := fn1() r2, err = fn2() if err != nil { return err } err check doesn't complain either
- oconnor663 8y agoThat second example is really surprising. This sort of thing happens all the time in production when lines get moved around. Does anyone know why errcheck misses it?
- agnivade 8y agoNot sure about that. But https://github.com/gordonklaus/ineffassign https://github.com/gordonklaus/ineffassign catches that.
- spdionis 8y agouse an IDE
- jashmatthews 8y agoGo has GC and a runtime so you can argue it's not really close to C/C++/Rust at all and much closer to AOT Java.
- hazz99 8y agoPersonally, I find the concurrency support quite lacking. Compared to Java/Javascript/Python/etc, it's great, but nothing compared to languages like Ada or Elixir. I wish we could use more than channels - for me, I often feel like I'm shoehorning them in because there's no support for protected objects (native queues, conditional variables etc). Perhaps I'm just using them wrong. Sometimes I have to use locks, and I don't think we should be forced to use locks in 2019. We've had better solutions since the 80s.
- sethammons 8y agoI find waitgroups to be similar to condvars
- grumpydba 8y ago> Sometimes I have to use locks, and I don't think we should be forced to use locks in 2019. We've had better solutions since the 80s. Absolutely not. Locks/spinlocks are found in pretty much every significantly parallel software project. It is pretty arrogant to criticize almost all software architectures on earth.
- hazz99 8y ago> It is pretty arrogant to criticize almost all software architectures on earth. Almost all software is programmed with modern languages, which all (imo) have extremely lackluster support for concurrency. It's not a symptom of the programmers, but the tools they work with. Who uses Ada these days? Locks should only be used when other protection mechanisms are too slow. Semantically, the critical region protected by a lock is not connected to the lock in any way. This can make debugging races super difficult, and you have to rely on everyone to lock everything at the right point. Juggling multiple locks in complex concurrent processes is difficult, and prone to bugs. I struggle to think of where a lock is required, barring the extremely hyperoptimised hot paths within operating systems, or similar applications.
- k__ 8y agoI talked with a few people who wrote Go servers and while they loved almost everything about the language and ecosystem, they hates the missing generics so much, they still switched to other languages later. Writing code-generators for everything wasn't fun.
- w8rbt 8y agoI don't miss generics in Go and I have used generics in C++ a good deal. I think the whole generics argument against Go is largely parroted by people who may not even know what generics even are. C doesn't have Generics either. It's doing OK.
- throwaway2048 8y agothat isn't true at all, function macros serve as the moral equivalent of generics.
- ryeguy 8y agoAny language that doesn't have generics, including C and Go, have to work around that limitation. In C, people get around this by using void* (equivalent to using interface{} in Go) or code generation via macros. I'd flip what you said and say that most of the people arguing against generics in Go don't have much or any experience with them. Which makes sense because a large number of users came from dynamically typed languages.
- apta 8y agoHere's a good starting list: https://www.reddit.com/r/programming/comments/an33mo/aspnet_core_saturating_10gbe_at_7_million_rps/efrvn0e/ https://www.reddit.com/r/programming/comments/an33mo/aspnet_...