Top
Best
New

Posted by xngbuilds 2 days ago

Just Use Go(blainsmith.com)
214 points | 201 commentspage 2
shantnutiwari 2 days ago|
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

chuckadams 1 day ago||
Maybe because the style is just worn-out ragebait trolling now.
mattgreenrocks 1 day ago|||
I am so over the presumptive blog post tone personally.
indigodaddy 2 days ago||
It's likely being flagged because people believe it's more AI-written than not
shantnutiwari 1 day ago||
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"

JKCalhoun 1 day ago|||
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…)

indigodaddy 1 day ago|||
Yeah I didn't flag it myself. I skimmed it and I didn't get an immediate AI vibe, like someone else said it seemed to be trying to use the motherf*in website style
runarberg 1 day ago|||
Unlike witches, LLM content exists. And worse, it has proliferated to a point where you are more likely to spot LLM content in the wild then human written content.

Witch hunts are bad because they target innocent people and burn them at the stake. When the whole internet has been filled with LLM content, it is not unreasonable, expected even, that you start accusing everything of being an LLM, because, most likely, it is.

nojvek 1 day ago|||
This one has major signs of LLM speak, specifically Claude.

Normal humans who rant like, actually rant. This is AI generated rant.

vinceguidry 1 day ago||
Yeah it's taking itself a bit more seriously than an actual human would.
killbot5000 2 days ago||
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 example, but one must consider all these things in a real system. Go does have good pathways for these concerns, but it’s also easy to do it wrong. I still have to manually reason about access to variables/struct fields from multiple go routines.

lanstin 2 days ago||
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).
jesseschalken 1 day ago||
Its absolutely laughable that Gophers act like their language solves concurrency when its actually worse than Java because it has data races. Go added nothing and moved backwards.

The language that actually solves concurrency is Rust, but they will never acknowledge that.

barnabee 2 days ago||
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.

pjmlp 1 day ago||
I bet if Rust was more mature back then, the Python to Go rewrite from Docker, and the Java to Go rewrite from Kubernetes would both have been into Rust instead, and that would be it.
OutOfHere 1 day ago||
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.
barnabee 1 day ago||
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.
wuschel 1 day ago||
I guess other languages that follow a stricter/larger compile time regimen e.g. Haskell, OCaml, Idris, ATS, F* would be suitable as well for this kind of approach. Like Go, OCaml seems to offer low compilation times.
chuckadams 2 days ago||
I'll grit my teeth and tolerate "if err != nil" if I have to, but null pointers are where I get off the train.
BadBadJellyBean 2 days ago||
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, etc. myself. There is no move command that can move a file or directory across fs boundaries. The little things.

avanai 2 days ago||

    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.
pdmccormick 1 day ago|||
This also works:

    var _ MyInterface = (*MyStruct)(nil)
In my mind as I read this, I am reminded that it is the receiver type *MyStruct that implements MyInterface. YMMV.
BadBadJellyBean 1 day ago||
This is a useful hack but just imagine someone coming from another language reading this. They'd have no idea what it's for. It looks a bit like the things C people do to themselves. And all just because someone didn't want a keyword or another form of annotation to signal that a struct should implement an interface.

These are the small things that annoy me about go.

BadBadJellyBean 1 day ago|||
That is helpful but I think that is still a fail for Go. This could and should be a simple annotation.
calcifer 2 days ago||
> 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.

BadBadJellyBean 1 day ago||
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.
calcifer 1 day ago||
That's surely the correct behaviour?
BadBadJellyBean 1 day ago||
It is. But it's also an inconvenience. In a language like Java I can just say that a class implements an interface. If the interface changes the compiler and the IDE tell me about the missing methods. Go not so much.
twic 2 days ago||
> The boring choice is the right choice. It always was.

Right, absolutely correct, Java is a great choice, so why does this post keep going on about Go?

vhodges 2 days ago||
EJB, Spring, Ant, Struts (I'm getting old - Like Hot Java Alpha 3 and Java applets old), maven, pom files, etc.

I used to love Java but the complexity merchants showed up and ruined the party. 1.5 was just coming out when I stopped doing Java dev. Kotlin might pull me back into the fold though for when I can't use Go.

therealdrag0 1 day ago|||
You can write apps without that stuff? Sure you should have 1 dependency management system, but otherwise you can write clean JVM apps in many languages, without DI or much else.
jeberle 1 day ago||||
The good stuff landed in Java 8, so you left the party too early. From Java 8 on it has changed direction completely (less OO + JavaBeans, more functional + ADTs). It feels like a completely different language from the Java 1.4 / 5 days.

https://en.wikipedia.org/wiki/Java_version_history#Java_SE_8...

twic 1 day ago||||
That was a long and dark time in history. We're still in the shadow of it. But these days a much better world is available - a more powerful language, good libraries, and much, much simpler frameworks.

To be clear, all the annotation and Java EE stuff is still going if you want it!

twic 1 day ago|||
jeberle made a completely factual reply to this, but people hate Java so much it's downvoted to dead.
bccdee 1 day ago|||
My big issue with Go is, the language just isn't that great. Zero values instead of sum types, reflection instead of proper macros, a mediocre module system…

Java's warts are far worse than Go. Everything is nullable. There's no module system to speak of. It's so IDE-dependant.

I agree with the spirit of "use boring technology." So thank god Go is boring enough that I don't have to write Java anymore.

za3faran 1 day ago||
> Everything is nullable

Only reference types, the same as in golang (which also has nullable pointers, and its interfaces interact weirdly with null). Java is getting value types, which can be declared as non-nullable.

> There's no module system to speak of.

https://dev.java/learn/modules/

> It's so IDE-dependant.

Modern Java has been simplified that you can run a hello world program as follows:

  $ cat Hello.java
    void main() {
        IO.println("Hello");
    }
  $ java Hello.java
  Hello
Furthermore, any non-trivial project is better served with an IDE, regardless of language.
bccdee 13 hours ago||
> Only reference types, the same as in golang

Everything's a reference in Java except primitives, and even primitives get object wrappers. In Java, String, Long, and Bool can all be null. Go isn't like that—only explicit pointer types and interfaces can be nil. In practice it really cuts down on NPEs.

> https://dev.java/learn/modules/

Ok, granted, but I have never seen these in actual use. Java's ecosystem is big enough that you can use Java for years and not even know it has modules. I find this profusion of features unboring for the same reason that C++ is unboring.

In Go, everything's already in modules. It's just simpler. And when they did add generics, it was backwards-compatible, so there was no Java 8/Java 11 thing.

> Furthermore, any non-trivial project is better served with an IDE

In any other language, I can get by fine with vim + LSP regardless of project size. Java has a uniquely bad LSP story.

baalimago 2 days ago|||
Lack of extensive standard library, for one. But yeah Java is pretty great. Spring boot/quarkus especially
mey 2 days ago|||
Where my brain went.
gib444 1 day ago|||
Well, Spring (Boot) is so hard to avoid running into at day jobs. And Spring is hell.
pjmlp 1 day ago||
Being into powerful tooling I never get this anti framework tooling.

Lets write Web applications in C powered CGIs via LLMs instead. /s

gib444 1 day ago||
Why did you invent a false dichotomy in your head and stoop to a sarcastic swipe at a straw man? Hardly curiosity is it?
pjmlp 1 day ago||
Because that is usually the extreme haters take.
VoodooJuJu 2 days ago||
[dead]
jesseschalken 1 day ago||
The single executable deployment hasn't been an advantage for a very long time. C# has Native AOT. Java/Kotlin/Scala have GraalVM native-image, plus Kotlin Native and Scala Native.

And of course there is Rust, which compared to Go has better performance, lower memory usage, smaller binaries, safe concurrency, safe resource handling, and a real type system with tagged unions.

The Go team built good tooling around a mediocre language. Now most other languages have caught up, and Gophers are left writing mind numbing `if err != nil` checks with no benefits left to show for it.

drewbug01 1 day ago||
> Your "clever" coworker can't sneak a seventeen-layer abstraction into the codebase because the language won't let him.

Oh boy, the author has clearly not seen some of the Go codebases I’ve seen.

Ukv 2 days ago||
> `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

Haven't really used Go, but can't someone just `result, _ := foo()` and go on using `result`, not checking any errors?

The way Rust does it seems closer to forcing you to handle any errors in order to obtain the result (though it is still easy to just `.unwrap()` without properly thinking about it).

chuckadams 1 day ago||
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.
Ukv 1 day ago||
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).
4ndrewl 1 day ago||
The point being that's how you've decided to deal with the error, by ignoring it.
Ukv 1 day ago||
Silently ignoring errors by leaving out some boilerplate doesn't really seem like an active/forced decision, or a selling point over the languages it disparages ("[...] hellscape doesn't make errors disappear, it just hides them"). Then that the correct path is the one of more resistance seems poor design, in my surface-level opinion.
4ndrewl 1 day ago||
It is a decision though, and one you have to consciously make for each and every occurrence. You can't just hope some catch block will eventually handle it...
Ukv 1 day ago||
I may be missing something, but I don't see how just forgetting to handle/propagate the error (and, say, causing data corruption by continuing with whatever empty/partial return value the function happens to give) would be a conscious decision.

Even when it is intentional, like writing some quick/dirty code and planning on handling errors properly later, I'd imagine it's difficult to grep for instances of unchecked errors in the way you can with `.unwrap()` - though tooling should help.

therealdrag0 1 day ago||
Personally, I don’t want to swallow errors I want to throw them. 90% of the time, I have a few small cross-cutting points (like an api controller) I want to catch and handle exceptions that get thrown from the rest of the code base.
shepherdjerred 1 day ago|
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

More comments...