October 23rd, 2024

Why you should use Go

The author praises Go for its simplicity, robust standard library, and efficiency in full-stack development, highlighting benefits like single binary deployments and effective concurrency, making it a practical programming choice.

Read original articleLink Icon
Why you should use Go

The author reflects on their journey with Go programming language, emphasizing its advantages over other languages, particularly in web development. After starting in frontend development with React, the author became frustrated with the constant updates and complexity of modern frameworks. They appreciate Go for its simplicity, minimalistic syntax, and the convergence of solutions across projects, which allows developers to focus on building products rather than debating coding styles. The standard library is highlighted as robust and reliable, reducing the need for external libraries. The author also discusses the benefits of using Go for full-stack development, particularly with tools like Templ that facilitate a hypermedia-driven approach. They mention the ease of database management with tools like sqlc, the joy of single binary deployments, and Go's efficient concurrency model. Performance is another strong point, as Go applications tend to be resource-efficient. Overall, the author advocates for Go as a practical choice for developers looking for a straightforward and effective programming experience.

- Go's simplicity and minimalistic syntax make it easy to learn and use.

- The standard library provides a comprehensive set of tools, reducing reliance on external libraries.

- Go is well-suited for full-stack development, promoting a hypermedia-driven approach.

- Single binary deployments simplify the deployment process and reduce resource usage.

- Go's performance and efficiency can lead to cost savings in cloud resource usage.

Link Icon 17 comments
By @umanwizard - 7 months
I can’t stand go. It is painful and annoying to write compared to almost any modern language. Yes it’s simple, and makes it easy to write concurrent programs using one particular style of concurrency, which are about the only good things anyone can say about it.

The proponents of go seem to have an almost cult-like devotion to simplicity. They think adding any facility for abstraction makes a language into a complicated mess like C++, and any type system feature that didn’t exist in C makes a language into an ivory tower academic plaything like Haskell. The way the author talks about spending all day writing a perfectly beautiful, inscrutable piece of Rust code is an example of that. Yes, there are a few things in rust that are a bit harder to understand, but not to such an exaggerated extent, and that strawman is really not the typical experience when writing Rust. It’s very unusual for an experienced user of any mainstream language (except C++) to have any real difficulty understanding what a given piece of code does.

By @xyzzy123 - 7 months
This horse has been long flogged to death.

My list: Mostly fits in my head, gc, not horribly slow, boring concurrency, low effort cross-compilation, good distribution story.

It's contentious but I like the "low abstraction ceiling". Go punishes people who want to turn everything into a framework or abstraction and rewards people who just knuckle down and write the code that solves the actual problem instance.

Is it the "best" programming language on any single axis? Absolutely not. Are the ergonomics right for getting stuff done? Yep, at least for this commenter.

By @mbvisti - 7 months
The author here, thanks for posting this. I can see a lot of people not agreeing with Go, that’s fine, I still love writing it everyday. Taking choices away from you in terms of language features enables you to focus on the problem you’re solving. That makes it a great choice to me.
By @zxilly - 7 months
The parts of Go that make the most sense to me are the default static linking and the easy cross-compilation. rust does part of this, but C-dependent crates are easy to introduce (e.g. openssl-sys) and directly cause cross-compilation to be a disaster.
By @foolfoolz - 7 months
go has excessive verbosity, poor error handling, rough edges for package/dependency management, and forces you to use interface for too many things.

it’s not a bad language, but i would not choose it for a new project or base my company around it

By @bsaul - 7 months
i'm at my point in my career (20 years xp) where i think every project should be built around pure functions and structs, sorted in modules. And only once you're sure there absolutely no other choices, add a bit of interfaces, class and inheritance. Which, imho should happen extremely rarely.

I've come to realize that the amount of useless abstractions we add just because the language lets us, instead of thinking more deeply about what exactly is the problem we're facing, is just insane.

By @p2detar - 7 months
Starting a new side gig with Go next month and I’m pretty excited. It’ll be my first big Go project. I’ll be using htmx to handle FE stuff and I’m still discussing with the UX designer (they use Webflow) if we can somehow take htmx into account at design time. MySQL as db (customer’s choice), so let’s see how that stacks up.
By @qaq - 7 months
It highly depends on the nature of the project. I like Go, but after prototyping my side project in a bunch of lang. ended up using Python (FastAPI, SQLModel) because it was literally order of magnitude less code than say doing same thing in Go.
By @dlachausse - 7 months
What do people use for authentication in Go web applications? To me that’s the big missing piece. Just about everything else is in the standard library.
By @aabbtree77 - 6 months
"Go is ripe for Web Development" - not really. See youtube videos by Web Dev Cody or Ben Davis who tried Golang in this context and went back to Ts.

I would say the major strength of Golang is practical community which tends to avoid elegant complexity. The downside is pointers and the lack of null-safety.

By @zactato - 7 months
They really committed an original sin by omitting generics in early versions of Go, it was added in more recent versions, but too late IMO.
By @groone - 7 months
All of these points apply to modern dotnet as well
By @pipeline_peak - 7 months
What exactly does Go have over C# other than being “sexy” and an emphasis on minimalism?

I’ve watched from the sidelines over the years. I hear more people talk about it than use it.

By @ycombinatrix - 7 months
Because it is Java 2.0
By @teqsun - 7 months
"because you want to work for Google" /s