Hacker News new | ask | show | jobs
by preseinger 1243 days ago
I think you may be alone in this assessment. Go is uniquely easy to understand, due to its small set of keywords and lack of esoteric e.g. sigils.
1 comments

Yeah, I had no idea how to read the Go code.

I'm also coming from a ruby/js/ocaml/elixir/erlang background.

The Go code, in its entirety:

    type HasName interface { Name() string }
    
    func Greet(n HasName) { fmt.Printf("Hello %s!\n", n.Name()) }
    
    type Joe struct {}
    
    func (_ *Joe) Name() string { return "Joe" }
    
    type Mike struct {}
    
    func (_ *Mike) Name() string { return "Mike" }
    
    func main() {
            joe := &Joe{}
            mike := &Mike{}
            Greet(mike)
            Greet(joe)
    }

You have no idea how to read this?
Yeah sorry, I had to drop it in chatgpt3 to explain it to me.

It’s like some sort of weird pseudo object oriented code.

The * and := are completely foreign. The string interpolation is weird.

Not sure what or why the &.

At the end of the day, if you went to college and learned programming, CS with Java or C, maybe this make sense.

I learned CS with Scheme, and OCaml… so your mileage may vary.