The Go programming language from a Java perspective — part 3
In this series’ first two articles, I described myself as a long-time Java engineer who has recently decided to give Go a go. Although I’ll always love Java, I know that it’s important to keep learning languages. I chose Go because it’s a statically-typed, compiled language that doesn’t face some of the issues (such as slow compile times and startup times) that Java faces.
This series is not meant to pit Java versus Go. Both are strong languages with their own strengths and weaknesses. Rather, it is meant to provide my first observations of Go as a Java developer. Given that I’m still learning about Go, I welcome any feedback if any readers believe that I’ve misrepresented Go (or Java, for that matter).
In this final article in the series, let’s take a step back from the nitty-gritty of coding in Go, and talk about Go’s compilation and startup times, how packages and modules help organize code and dependencies, and some advanced functionality that’s built into the core of Go.
One of the most oft-touted benefits of Go is its speed. Not just its runtime performance, but its compile and startup times. In fact, addressing the slow build times of other languages is cited by the language’s creators as a primary motivator for creating Go.
By contrast, Java is criticized for its compile times and — even more so — its startup times. I’ve mostly switched from Spring (a great framework, but one whose dependency wiring can cause painfully slow launch times) to newer frameworks such as Vert.x and Quarkus. These frameworks eschew most of Spring’s baggage and provide noticeable performance improvements. But there is still a clear lag, particularly noticeable during Cloud Run cold starts.
#programming #golang #software-development #java #software-engineering
Go for Java Devs — Compiling, Packages and Modules, and Built-In Functionality. The Go programming language from a Java perspective — part 3. In this series’ first two articles, I described myself as a long-time Java engineer who has recently decided to give Go a go.