Live data from Hacker News

Just Use Go

blainsmith.com

71–80 of 238 posts

Re: Just Use Go

#71
> if err != nil is the feature, not the bug. It forces you to look at every place something can go wrong and decide what to do about it.

It truly does not.

Re: Just Use Go

#73

Not mentioned is that Gemini does a pretty good job of writing Go in my experience of using it to generate utility scripts, and a friend’s use of generating an internal website for using a corporate API.

I've typically leaned towards Python for my agentic programming, because the LLMs have been good at it and I'm familiar with it if I need to take a look. But I'm just finishing up an apt-cacher replacement and decided to use golang and the experience has been really great.

I'm using CC+Opus 4.7 max effort, and it's produced a working apt cacher from the first phase of development, so far there have only been a few things I've had to ask it to fix. This is over ~52KLOC (counted by "wc -l"), going on day 3 of it working on it. This includes: caching proxy, garbage collection, "http://HTTPS///" kludge (apt-cacher-ng semantics), MITM https proxy, admin website + metrics, deep validation of metadata and rejecting invalid updates, snapshots of upstream state and delayed metadata update until "hot packages" are available after metadata update...

10/10, would go again.

FYI: My agent loop is: "Work on next step, have codex review it, compact", and then a couple rounds at the end of a phase to review the code against the spec, and a couple rounds at the beginning of a phase to create the spec.

Re: Just Use Go

#74

I love go, but I find it did little to make concurrency management easier to reason about. Race conditions are easy to write. Go routines have all the same concurrency problems of threads. In the parallel HTTP fetcher, the error is discarded. This will likely result in a panic when the response is nil. Also, what if it a server locks up? Or the underlying socket never connects and never times out? I know it’s a toy e…

I find I have to design servers from a data flow view; when my performance demands let me do everything via channels to worker goroutine pools (including sending a response Channel back to the request handler) I don’t have to do any locking at all. I find when I have to add in mutexes it means I haven’t thought enough about the problem (or I am fixing some hot spot from the profiler, rarely).

Re: Just Use Go

#75
Why is this flagged? Because of the swearing? Cause there have been previous posts with swearing in them? Or do people in general hate Go so much?

I know the OP said dont use external libraries, but I love bubble tea (And their related libs), they are a great reason to use Go for TUI

that said, I only use Go for hobby projects, I dont know how good it feels if you have to use it for work 40 hours a week

Re: Just Use Go

#76
Just fucking use the language appropriate to the task you're trying to accomplish.

Just fucking use the language your colleagues can understand and support for the next few years.

Just fucking use the language with the framework and tooling you need to get your job done efficiently and effectively, and one at the appropriate level of abstraction for the project.

Just fucking use the language which AI agents can read and write well, because we're in the End Times and this stuff matters.

Just fucking use the language with great testing and CI/CD support because you'll be spending longer supporting your code than writing it.

The skill is choosing well, and a key realisation is that it's never a one-size-fits-all thing. That's why an article like this is less than helpful, gosh darn it.

Re: Just Use Go

#77

Go, similar to Rust, has a horrible ecosystem, IMHO. I want to like it, but they already broke backwards compatibility with older systems (try to get the Go compiler running on a slightly older OS X, f.ex.), and for a compiler that's a no-go to me.

Isn't that the same thing that Homebrew does? It only has CI for the last couple of Mac OS X versions. Seems like this is more of an issue with Mac OS X architecture than Go.

Re: Just Use Go

#78

Why is this flagged? Because of the swearing? Cause there have been previous posts with swearing in them? Or do people in general hate Go so much? I know the OP said dont use external libraries, but I love bubble tea (And their related libs), they are a great reason to use Go for TUI that said, I only use Go for hobby projects, I dont know how good it feels if you have to use it for work 40 hours a week

It's likely being flagged because people believe it's more AI-written than not

Re: Just Use Go

#79
post #34

I know it doesn't matter, but... ...who invented this letter-casing convention? import ( "embed" "html/template" "net/http" ) //go:embed templates/*.html var files embed.FS var tmpl = template.Must(template.ParseFS(files, "templates/*.html")) why is the name of a module lower-cased but the names of functions accessed via its namespace upper-cased? how does this make sense?

Upper case symbols in a module are exported. Everything else should be lower case.

Re: Just Use Go

#80
post #12

There's a lot of merit in this. I call Go the Honda Odyssey Minivan of the programming world. It doesn't do anything exceptionally well but it does lots really well and in a way that's simple and reliable. Especially for the backend serving react front end niche. But it's also a pig to write and comes with a lot of foot guns. Especially the Null handling. Somehow they made it worse than every other language.

Why the Null handling and in Go is worse than others?
Post reply on HN