2 ms·
The vast majority of my work has been on the JVM - and most of that in Java. I tried Go for a while, and came away pretty unhappy. First, similarities: Go seem
by blandflakes 6y ago
The vast majority of my work has been on the JVM - and most of that in Java. I tried Go for a while, and came away pretty unhappy.
First, similarities:
Go seems like a really good language for building software for teams. It's straightforward and simple, and generally what you see is what you get. That's great.
Where it wins:
- having a standard formatter is amazing
- having a compiler that is fast, and an executable that starts fast and runs quickly is great
- the built-in http stuff seems better than what was available in Java's stlib for years
- channels are nice
- lower resource usage, especially memory
- by breaking with the JVM, you get to abandon a lot of bad patterns because they simply aren't available
Where it loses:
- I simply don't need pointers for the places I want to use Go
- the GC, though different, still needs tuning/consideration for high-load, and if I have to mess with GCs I want the options available to me on the JVM
- the dependency management story was rough for a while, though that seems to have settled into something more mature
- the error handling is unacceptably anemic
- the type system is unacceptably anemic. I'm not even talking about generics (maybe I am) - it just seems moronic to have to subvert it with "interface{}" all the time, which also renders the documentation pretty opaque to me.
Overall Go is a solid tool, and I see why it's so successful, especially for network stuff and command-line tools. It's hard to overstate how great an experience it is to have a fast-compile loop and I really envy that (I feel this way any time I use most languages not on the JVM).
And for learning something new, there's nothing novel that I've seen in Go. If you want to use it because it is pragmatic and efficient, that's a great reason.
- premek 6y agothanks for a great comment, I feel similar about most of the stuff
- avinassh 6y agoHow was experience using Go routines? And how would you compare it with Java? I am sure Java would have something similar
- pjmlp 6y agoIt had green threads in the early day, than concurrency packages, finally project Loom with virtual threads.
- blandflakes 6y agoThey (Go routines) mostly get out of the way and provide some abstraction over what I've typically used things like Future for in Scala. As pjmlp mentioned, The concurrency package is pretty nice to know, and offers functionality to chain work or fire off an async task or enqueue stuff to be done as messages, but it's not as trivial as marking a function async. Clojure and Scala have more direct paths to this sort of convenience. Loom will be interesting!