Hacker News new | ask | show | jobs
by yashap 1465 days ago
Agreed with the article, though obviously it’s a bit dated (especially around generics and package management).

My take is that Go is basically the new Java, with fewer abstractions and faster compilation. Although, the pre-Java 8 Java, before Java started to get a bit functional.

Like Java it’s a practical, imperative, statically typed, garbage collected language with very good performance. Also like (pre-Java 8) Java, it’s very verbose, doesn’t allow for much “elegance”, and many find it not very fun to write. But it is a pretty decent language for getting shit done.

Overall, I don’t really enjoying writing Go, but it’s not the worst either. I’d code in it if necessary, but wouldn’t chose it for a personal project. I just have more fun and am more productive writing code in concise, mixed OOP/FP languages like TypeScript or Scala, even if they don’t compile as fast.

4 comments

It's the new Java 4. Eventually they'll add the missing stuff and it'll get current with Java 6.
I would really like to see a benchmark on compilation speed. Sure, Go’s compiler is really fast by not doing any fancy optimizations - but.. have you seen javac’s byte code output? It barely does constant propagation, because it can get away with it due to JIT. So if anything, javac just starts up a bit slower, or the build tool does something at first start but otherwise java programs literally compile in a blink of an eye.
I’d like to see that too, share it if you find it! My personal experience has been that the Go projects I’ve worked on have compiled a lot faster than the Java projects I’ve worked on. However, it’s hardly a 1:1 comparison, the Go projects were much newer and smaller than the Java projects, would like to see some legit benchmarks.
Surprised you compare it to pre-Java 8 considering functions have first class support in go.
First class functions are a lot less interesting without functional data structures, with methods like map, filter, reduce, etc. These were added in Java 8, but Go has always been against them. This may change with generics, people can certainly write their own now, but I’m on the fence about whether they’ll catch on. I think they still won’t be overly nice to use in Go because:

- Go’s lambdas are extremely verbose. “Concise but clear” is a big part of what people live about functional data structures, Go won’t have the concise part

- Go will still have almost no support for immutability, which works beautifully with functional data structures

Code like this is nice to write:

users.map((user) => user.id)

While code like this isn’t:

users.map(func (user User) string { return user.id })

The Scala ecosystem is super cool, once you're able to groc all of the neat stuff happening, sort the good tools from the bad, etc. Love http4s, scala-js, scalajs-react, doobie, cats, etc.