logoalt Hacker News

dralleyyesterday at 5:48 PM2 repliesview on HN

For whatever reason, maybe not even logical ones, Go repulses me. I don't know why exactly, I like the idea of Go, but the aesthetics rub me wrong.

I think it's the use of pointers and "if err != nil {}" error handling spam. It reads as a highly compromised imitation of Python and C rather than a solid execution of some other idea.

Rust is not the most beautiful language out there but it doesn't trigger any such reaction for me. The ? operator and "match", which I use constantly, more than compensate for some of the sigil noise which I barely need to look at much less write most of the time. So Rust wins on that comparison for me.

The "func name() -> retval" syntax also grew on me. I like the fact that Python type annotations copied that approach, and C-style declarations look ugly to me now. Same with C-style /* */ comments.


Replies

kev009yesterday at 6:13 PM

Because Go is kind of a Steampunk design. The creators collectively ignored decades of PL developments. What that nets is kind of a C without sharp edges, but can't be used where C can.

Rust is definitely jarring to look at, in the same way that decoding some strange C declaration can be, in ye olde days when you had to float all this context in your mind while doing work. But with modern tooling who cares: "explain this lifetime to me"

odo1242yesterday at 6:39 PM

For me it's mainly the if err != nil {} stuff and the fact that everything is package scoped (C-style enums and constants).

You can pretty clearly see the limitations if you read, for example, the type of code the Protobuf compiler generates when trying to compile Protobuf/gRPC enums or structs into the way-more-limited Golang type system (this is despite the two being designed to work together). And it could really do with algerbraic data types and other modern programming language features.

Also the type system does have a couple weird behaviors that seem straight out of JavaScript. Like the difference between struct and interface nil for example:

```

var buf *bytes.Buffer = nil

var out io.Writer = buf // now out is nil

if out != nil {

    // This block will execute because out is not nil

    out.Write([]byte("crash")) // This line will crash because out is nil
}

```

Many things about the language almost seem to be designed to simplify the implementation of the compiler rather than to benefit the developer experience.