Live data from Hacker News

Just Use Go

blainsmith.com

101–110 of 238 posts

Re: Just Use Go

#101
post #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?

It sets primitives to 0, "", false etc. Which is almost always but not always fine. And if they're complex objects you still get NPEs

To get true nullable fields you need to use pointers. That's a whole topic in itself but they're awkward.

It's much worse than true nullable objects that your compiler can check for NPEs. It throws fewer NPEs but at the expense of data integrity where you don't know if your 0 is actually a 0 from the user or a null.

Re: Just Use Go

#102

I can write go but I don't prefer it. It's ... okay. Things I dislike: - if err != nil. Just give me some syntactic sugar instead of letting me write the same thing a bajillion time. - no way to bind a struct to an interface. I'd like my IDE to tell me when I accidentally stopped implementing an interface - some stdlib parts are too bare bones. Unpacking an archive requires me to handle all files, directories, links,…

> I'd like my IDE to tell me when I accidentally stopped implementing an interface I don't know about others, but Goland's analyser is pretty powerful and can navigate from interface to implementation(s) and vice versa.

In my experience only when you implement it correctly. If I add a new method to the interface I can't navigate to the implementations anymore because they don't completely implement the interface.

Re: Just Use Go

#103
Go is probably my second least favorite language, right behind C++

You need a lot of linters e.g. to make sure errors are being handled, and the lack of algebraic data types make expressing data difficult.

I do think it has merits, but I’ll take type safety over simplicity

Re: Just Use Go

#104
post #61

I can write go but I don't prefer it. It's ... okay. Things I dislike: - if err != nil. Just give me some syntactic sugar instead of letting me write the same thing a bajillion time. - no way to bind a struct to an interface. I'd like my IDE to tell me when I accidentally stopped implementing an interface - some stdlib parts are too bare bones. Unpacking an archive requires me to handle all files, directories, links,…

var _ MyInterface = &MyStruct{} Now your compiler will tell you you stopped implementing the interface. Pretty? No. But it works. And gopls will even offer to implement stubs for missing methods.

That is helpful but I think that is still a fail for Go. This could and should be a simple annotation.

Re: Just Use Go

#105

I can't see any reason this list why I should use Go over C# / .NET. .NET has almost all these upsides, but with a concurrency model (async/await) that is (now) more transferable to other languages.

I can see reasons why people don't want to use .NET if Go is available. .NET has its merits but it's bloated, compilation is slow, and I find it's tooling to be really annoying.

For me go is just above c# and both of those are not super high on my list.

Re: Just Use Go

#106

Now that LLMs can breeze through the Rust boilerplate there's no reason to ever write Go again. It's one of the dullest, most mediocre languages out there and despite a nice toolchain and the fact it's undoubtedly a "safe" choice, I just have zero interest.

Someone has to review the LLM generated code. If it's not the developer, it's the SRE at 2 am. For someone without significant experience, it might be harder to review Rust than Go.

Not sure it's harder. Rust type system makes it much harder to shoot yourself in the foot with nils and errors, at least. Biggest issue is probably the number of 3rd party dependencies every non-trivial Rust app ends up needing.

Re: Just Use Go

#107
post #25

A dig at Django's ORM seems hilarious. I wonder how many SQL injection vulnerabilities are written daily by Go devs.

sqlc is pretty darn great but it's no comparison to Django. Django has its own problems and I would love for it to take some lessons from sqlc. Really hate we don't have proper type hints for Django.

Is django the best backend batteries included framework at the moment?

Re: Just Use Go

#108
post #99

Earlier quoted context omitted.

We do want to check for errors, we'd just prefer that it not be a repeated 3-line boilerplate pattern that ends up being >50% of all code. Rust does it with one character.

I agree that Rust's approach is better. I'm questioning the claim that Go "forces you" to handle errors, since to my understanding with Go someone can just eschew that 3-line boilerplate, silently ignoring the error, and still use the result (which is bad).

The point being that's how you've decided to deal with the error, by ignoring it.

Re: Just Use Go

#109

I've worked on large Go codebases on large teams at large orgs with large dreams. That garbage us straight up unmaintainable in the large and nobody can convince me otherwise. I have deep knowledge of the language, platform, used it for over a decade. It sucks.

It sucks because?

Account created one hour ago...

Re: Just Use Go

#110

Earlier quoted context omitted.

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

Let me copy paste my other comment: "This is getting really fucking irritating. Every 3rd comment on every HN post is "This is LLM", which has become a proxy for "I dont like it so it must be llm"

Yeah, I suppose I am in the minority here, but I still judge a posts on their merits.

LLM witch hunts are tiresome.

(Perhaps the worst part too is that an accusation can be leveled and there's no way to counter. If it's a vacuous fluff piece, say so—irregardless of who/how it was written. And there we are judging a piece on its merits…)

Post reply on HN