by laerus · 4y ago · 0 comments
I don't even get why Golang is considered a good language. The new goto primitive for concurrency, the half baked error handling, the fact that it's designers think that programmers are not smart enough and made a language that looks like Java and feels like Python (but hey, no class inheritance and the compile times are faaast) are just a few of the examples that don't make it good enough for me. I wonder how popular Golang would have been if it wasn't backed up by it's company.
What is this tendency for the software industry to try and make everything "easy"? Trying to oversimplify something that is inherently complex only adds accidental complexity.
Programming languages are there to make programmers productive. Otherwise we would all work in something like assembly (I've done that but try to stay away from it now).
Go attempts to do this by hiding the complexity. When people have to spend time dealing with language (or platform) complexity they have less time to spend on their business logic or the core thing they are trying to do. By making the complex simple for the majority of cases they enable people to be more productive in solving their specific issues.
I say all of this as someone who likes and has issues with both Go and Rust. And, every language I've ever used.
100% agree and I find I can produce more software value [1] per unit time/effort in Golang than anything else.
Is it the perfect language? No, there are certainly some warts, but no show-stoppers, and no more than other languages.
[1] "software value" being defined as software that meets its requirements, is easy to write and build initially, easy to maintain by others, and performant enough not to need extra-ordinary hardware.
Have you looked at the history of the creators of Go? If not, I would suggest looking into it. 2 of the 3 have an amazing history in terms of computing.
I think Go is notable for its scarcity. It has few features which interact well together. It is extremely light in abstraction, so understanding whats really going on takes far less work than basically any other language out there (maybe C is a competitor here, but C is hard to understand for other reasons). Simplicity is not novel, but it allows the programmer to forget about questions which have little relevance to the problem they're trying to solve (e.g whats the ideal type structure for this program) and focus on questions more like "how should this work".
It's a language that recognizes that cleaning your room by stuffing your clothes under the bed actually works in programming.
For golang it lists: Kubernetes, Docker, Github CLI, Hugo, Caddy, Drone, Ethereum, Syncthing, Terraform
For Rust it lists: Firefox, ripgrep, alacritty, deno, Habitat
While both lists are a bit cherry-picked and some not really true, it is certainly true that there are significant more (I'd guess 1 or 2 orders of magnitude) large projects using Golang.
What do you make of the fact? Certainly it's not programmers that want to be treated like they're not smart. Nor can you assume all the different team's engineering leaders made foolish decisions.
[1] https://thenewstack.io/rust-vs-go-why-theyre-better-together...
I think Go's been a mature base for those kinds of projects long enough for them to have been written. Rust not only is newer but arguably is still pretty immature for network programming. For sync code, the library base isn't there and probably never will be (because most of the libraries are being written for tokio instead). For async code, there are still a bunch of well-known difficulties. [1] This is my biggest complaint about Rust. People are aware of it and working to improve it, so I hope to see a change over the next several years. It will never be as simple as Go, though. Go's green threads model has downsides but it is really pleasant and simple to program in.
[1] e.g. see https://carllerche.com/2021/06/17/six-ways-to-make-async-rus...
Golang hit 1.0 in 2012, Rust in 2015. That's a big factor.
Golang has been marketed heavily by Google, Rust doesn't have an equivalent sponsor. That's also a factor.
There's also a difference in focal domain, with Rust’s focus in places where evaluation and replacement cycles are naturally longer and that are deeper at the core of infrastructure.
Where is this marketing by google? Though I don't really understand the point of this line of questioning anyways.
Sounds like bullshit to me. Go did not even have proper Google branded website until last year.
It has its use cases, it's basically a faster python, and it's good for writing command line apps since it compiles to native code. Other than that, it has nothing going for it especially compared to proper mature server side languages like Java and C#.
Even its compile times are not that impressive when programs get large, which is quite ironic.
As you point out, its design philosophy is overly simplistic to the point of being almost naive. Complexity exists in the real world, there's no getting away from it, and if you keep your language deliberately "simple", you are pushing complexity to the user.
I wouldn't even say golang looks like Java. Java has evolved quite significantly in the past few years, adding many useful features that further aid in program modeling ability and expressiveness, like records and pattern matching. Not to mention it getting green threads that are going to be better implemented than golang's "goroutines" by virtue of having structured concurrency built in from the start.
The world is complex, it's just reality. The question becomes where do you want to push that complexity, on the user or on the language? golang decides the former, which is why you end up with messes like the kubernetes code base.
But there is a tradeoff. Every complex feature you add has a continuous cost applied to every reader, in that they have to become expert with the new feature. C++ is a great example of the failure mode here, and even Java has too many features such that using many of them will confuse most of my coworkers. Having few features means that the code is more accessible, and you can spend your cognitive load on the genuine complexity of your problem rather than fiddling with language knobs.
But yeah it seems to be more of a competitor vs Python and Ruby than vs Rust.
Because it's a more 'get shit done' language (with a fast solid runtime, good stdlib and and fast compiles), it's not concerned with giving its users the means and ergonomics to produce the most beautiful programs, instead, a language for the majority of backend developers.
I wouldn't guess it's super fast, but the super-power of Go is you can use all those cores efficiently without getting dragged down and murdered by a lot of mutex/lock stuff, and it's efficient and fast with medium-high volumes (few K/second of messages per core, that sort of thing).
Both of those servers were left behind and maintained successfully by other people, so I don't think they are examples of a pile of tech debt. They are invisible network appliance type code, but customized to be super-precisely what was needed for specific network problems.
It is as fast to dev in as Python, lets me mix and match data structures and algorithms via problem-specific structs, and is able to use my hardware.
Unless you can elaborate more, this is pretty meaningless. I could make the same statement about Rust or literally any language and it would be just as substantial.
- people who code in Rust and hate it do so because they keep fighting the borrow checker;
- people who code in go and hate it do so because their code is buggy.
Now I code regularly in Rust, I enjoy it very much and I very much understand why some people dislike the borrow checker. I prefer Rust but I very much understand why some of these developers may prefer go (or Python, or TypeScript, etc.).
On the other hand, I don't code in go (sufficiently) to know whether go is as full of gotchas as developers who hate go make it look.
As for Golang fanboyism which contrary to Rust is almost none existent, I mean on every HN / Reddit post you're going to get someone that will tell you about Rust, why would you use a language with GC, error handling, no sum types etc ... hinting that it's the best language, something that you never see with Go users.