Live data from Hacker News

Go is my hammer, and everything is a nail

maragu.dev

121–130 of 816 posts

Re: Go is my hammer, and everything is a nail

#121
I've been coding in Go for over five years. I like Go, but I don't love it. It's never my first choice, although I don't advocate for rewrites just to move away from it.

The tooling is a mess. Go modules still feel like a 'first pass' implementation that never got finished. There's no consistency in formatting or imports (even though Go claims there is). Generics are a good step but are still very primitive (no generics on interfaces, no types as a first-class object).

It still feels very unfinished as an ecosystem. I hope it'll get better as the Go team mature things, like iterating on generics. But I can't see Go modules continuing without a fundamental rewrite.

Re: Go is my hammer, and everything is a nail

#123
post #95
post #47

The author lists multiple reasons for this, but for me the biggest one is the first one: Go is good for almost everything . I have extremely good productivity when using Go. Once your project exceeds 100 lines it is usually even better than python. And yes, I am aware that Rustians did a survey where Rust was crowned as the most efficient language but in my reality (which may differ from yours) Go is simply the best…

How is it different than, say, java for this generalist purpose?

Just from an ergonomic standpoint it's a million times easier to deploy a go binary instead of a whole jvm and a jar file.

Re: Go is my hammer, and everything is a nail

#124
post #105

Go is everything I don’t want in a language for my personal projects. It’s verbose, every simple task feels like a lot to write. It’s not expressive, what would be a one-liner in Python makes you write three for loops in Go. I constantly need to find workarounds for the lack of proper enums, lack of sum types, no null safety etc. I’m sure these are the exact reasons why Go is good for enterprise software, but for per…

Damn, everything new really is old again. Everyone said the same thing about Java. Yet it still works and gets the job done. Go does as well. I'd rather poke my eyes out with a nail than use Python.

Re: Go is my hammer, and everything is a nail

#125
post #95
post #47

The author lists multiple reasons for this, but for me the biggest one is the first one: Go is good for almost everything . I have extremely good productivity when using Go. Once your project exceeds 100 lines it is usually even better than python. And yes, I am aware that Rustians did a survey where Rust was crowned as the most efficient language but in my reality (which may differ from yours) Go is simply the best…

How is it different than, say, java for this generalist purpose?

java on its own is not a competitor to go, IMO, due to the batteries included "culture" in the go ecosystem.

I would need to compare it with, for example, Java + Spring(Boot).

I find Go to be simpler and more pleasant to use.

Re: Go is my hammer, and everything is a nail

#126
post #17

Earlier quoted context omitted.

Can you give me an example of a decent UI framework? Or frameworks? (I'm not a GUI programmer, but I've been dabbling a bit using Fyne. I figured that in the C++/C# sphere UI frameworks especially on Windows were sorted out until I read an article by some frustrated individual who listed all the problems he has with various UI frameworks on Windows. So I realized that perhaps this isn't as well sorted as I thought. I…

Cogent Core looks promising.

I wasn't aware of that project. This looks pretty new, but after clicking around a bit in the documentation looks very interesting. I get the impression that it isn't as verbose as a lot of other frameworks I've seen.

Re: Go is my hammer, and everything is a nail

#127
post #105

Go is everything I don’t want in a language for my personal projects. It’s verbose, every simple task feels like a lot to write. It’s not expressive, what would be a one-liner in Python makes you write three for loops in Go. I constantly need to find workarounds for the lack of proper enums, lack of sum types, no null safety etc. I’m sure these are the exact reasons why Go is good for enterprise software, but for per…

I would rather go had real enums, and I would _prefer_ if there were sum types.

I agree it's more verbose, but I don't find that that verbosity really bothers me most of the time. Is

    res= [x for x in foo if "banned" in x]
really actually more readable than

    var result []string
    for _, x := range foo {
        if strings.Contains(x, "banned") {
            result = append(result, x)
        }
    }
? I know it's 6 lines vs 1, but in practice I look at that and it's just as readable.

I think go's attitude here (for the most part) of "there's likely only one dumb, obvious way to do this" is a benefit, and it makes me think more about the higher level rather than what's the most go-esque way to do this.

Re: Go is my hammer, and everything is a nail

#128

I've been coding in Go for over five years. I like Go, but I don't love it. It's never my first choice, although I don't advocate for rewrites just to move away from it. The tooling is a mess. Go modules still feel like a 'first pass' implementation that never got finished. There's no consistency in formatting or imports (even though Go claims there is). Generics are a good step but are still very primitive (no gener…

What do you mean by no consistency in formatting? go fmt is a solid formatter that does its job

Re: Go is my hammer, and everything is a nail

#129
post #95
post #47

The author lists multiple reasons for this, but for me the biggest one is the first one: Go is good for almost everything . I have extremely good productivity when using Go. Once your project exceeds 100 lines it is usually even better than python. And yes, I am aware that Rustians did a survey where Rust was crowned as the most efficient language but in my reality (which may differ from yours) Go is simply the best…

How is it different than, say, java for this generalist purpose?

IME, there are two main differences between go and java:

1) go is more "batteries included". Modules, linting, testing, and much more are all part of the standard cli. Also, the go stdlib has a ton of stuff; in java, there is almost always a well-built third party library, but that requires you to find and learn more things instead of just reaching for stdlib every time.

2) golang is "newer" and "more refined". this is pretty subjective, but golang seems to have fewer features and the features are more well-planned. It's a more "compact" or "ergonomic" language. Whereas java has built up a lot of different features and not all of them are great. You can always ignore the java features you don't like ofc, but this is still a bit of cognitive overhead and increased learning time.

Re: Go is my hammer, and everything is a nail

#130
post #34

> all popular programming languages can do basically anything That's just very not true...

It's true in terms of Turing Completeness.

Turing complete just means you can simulate a Turing machine.

A Turing machine is a mathematical model of a computer, it’s not a real computer.

Real computers can do things that Turing machines can’t do, e.g. generating random numbers[0], interfacing with hardware, etc.

[0] https://en.wikipedia.org/wiki/RDRAND

Post reply on HN