Java vs Go
Where is Go lacking in Enterprise adoption?
Published: Monday, Apr 5, 2021 Last modified: Thursday, Nov 14, 2024
Modern Java is a well known and massive Ecosystem in the Enterprise.
Go (2009) on the other hand is probably best known as a “Google language”, notably powering Web Apps (APIs) and DevOps (Docker) workloads.
Java compared to Go
Strengths:
- Mature JVM that effectively compiles code once warmed up (just-in-time compiler)
- Massive amount of libraries
- Many developers in the market
Weaknesses:
- Confusing licensing terms esp regarding their API
- Bloat everywhere
- Slow iterations
- Verbose
- No clear way to do one one thing e.g. maven/gradle, tomcat/undertow
- A lot of knowledge is needed for certain use cases like serverless since performance time needs to be tweaked, creating hassles for devops teams who might be a little weak on Java insider knowledge
- Requires an IDE for productivity
- Reliance on heavyweight tooling
- Some fragmentation - Scala & Kotlin might offer short term productivity gains, but long term support is unknown
Go compared to Java
Strengths:
- Simple BSD licensing
- Simple, well designed language
- Strong standard library for most needs with a growing third party package ecosystem
- Less moving parts (LOC)
- Concurrency is easier to achieve
- Backed by Google with several case studies - together with a survey claiming developer productivity boosts
- Build (no gradle!), packaging & testing is part of the distribution (no tricky choices)
- Debugger (delve), code formatter (gofmt), profiler & language server (gopls) independent of any IDE so any editor can integrate (including vim!)
- Near instant build/run times - great for serverless
- Better error capture
- Growing libraries
- https://play.golang.org/ makes it simple to share running code by URL
Weaknesses:
There is generally a higher demand for good engineers than supply in Singapore.
— Sau Sheong (@sausheong) April 7, 2021
- Scarcity hiring Go developers
- Not as mature as the Java ecosystem
Conclusion
Finding a good engineer is a problem with any programming language. Go is easy to learn and productive with “just works” developer experience, unlike Java which has many crufty corners and is quite a painful developer experience. Furthermore with the Infrastructure trend to go managed runtime with Serverless, Go is a better goto candidate to get up and running.
Whether Java or Go depends also on what you're trying to deliver. Sometimes a well-established Java library that is highly performant makes it well worth going with Java too. It's not black or white.
— Sau Sheong (@sausheong) April 7, 2021