My Go vs Java preferences in favour of Go. Low cognitive overhead Goroutines Channels Answer from lickety-split1800 on reddit.com
🌐
Reddit
reddit.com › r/golang › go vs java
r/golang on Reddit: Go vs Java
May 27, 2025 -

Golang has many advantages over Java such as simple syntax, microservice compatibility, lightweight threads, and fast performance. But are there any areas where Java is superior to Go? In which cases would you prefer to use Java instead of Go?

Top answer
1 of 5
421
Java has a bigger, more mature ecosystem, due to being around since the mid 1990's. That's probably the main measurable thing that isn't just someone's opinion.
2 of 5
123
I come from a Java background but writing Go since a few years. Like both languages. Today I prefer Go over Java to do basically anything. That being said, I think Java’s stronger points are: No pointers. You still need to know the difference between primitives vs objects but you never see the pointer syntax and logic (For me they are completely fine, but I know some devs who find them confusing, never actually “got” them and never want to see them in code) Java frameworks, harnessing the power of reflection (basically the whole compile time info being there at runtime) work really magically. (I’m not a big fan of magic, don’t think they are worth the tradeoff, but they really make some things with very small amount of “tidy” code possible) Functional features, stream API etc. Very mature and solid frameworks and libraries. Some come to mind are Spring, Jackson, Guava (great stuff for caching in it), OkHttp, and various Apache libraries. Perfect developer tooling: IntelliJ Idea, debuggers, VisualVM and other profiling tools and so on (JVM makes a lot of things work “perfectly” there) Constructors making default values possible. Better relation with immutability. Many useful data structures in standard library. Some examples are: LinkedHashMap, TreeSet, ConcurrentMap and so on.
🌐
Roadmap
roadmap.sh › golang › vs-java
Go vs Java: Choosing the Right Language for Your Projects
You may wonder which language is superior and what considerations should guide your choice. Let's dive deep into the side-by-side comparison of these two languages. Golang outperforms Java and is often compared to high-performance programming languages like C or C++ because it compiles into ...
Discussions

Reasons you prefer Golang over Java?
My Go vs Java preferences in favour of Go. Low cognitive overhead Goroutines Channels More on reddit.com
🌐 r/golang
260
231
May 17, 2023
go - Speed of Golang Vs Java - Stack Overflow
I have written a program in Java and equivalent in Go. My java program is taking around 5.95 seconds to execute while Go program is taking around 41.675789791 seconds. While speed of Go is comparab... More on stackoverflow.com
🌐 stackoverflow.com
What are your thoughts after moving from Java to Go
I’ve made the reverse switch. Was doing backend Go work, and now I’m doing backend Java work. (It’s all about the team and the company you work for.) The differences don’t seem like they’re that important to me. It’s easy to build your project (Go is easier), easy to consume dependencies, and easy to run tests. IDE support is good (Java has it better). Overall, I prefer Go. But it’s not like one of these languages has a decisive advantage over the other. I like Go’s error handling. I like that not everything is a class. I like having multiple returns from a function. I like struct literals over using the builder pattern / fluent interfaces everywhere. Go’s standard library feels a little more complete and more coherent (Java has some baggage). It’s a little easier to navigate through a typical Go project. At the end of the day, these are just preferences. It’s not like I’m unhappy writing Java, I just prefer Go. More on reddit.com
🌐 r/golang
124
144
January 12, 2024
Go vs Java
Java has a bigger, more mature ecosystem, due to being around since the mid 1990's. That's probably the main measurable thing that isn't just someone's opinion. More on reddit.com
🌐 r/golang
259
225
May 27, 2025
People also ask

What is better than Golang?

Node.js is a language that can easily compete with Golang and has a far larger community and more supporting tools.

🌐
bairesdev.com
bairesdev.com › home › blog › software development
Golang vs Java: Programming Languages Compared and How to Choose
Is Java still worth learning?

Very much so. If you’re building mobile applications, web apps, or have to integrate with AI applications or IoT devices, Java could very well be your best bet.

🌐
bairesdev.com
bairesdev.com › home › blog › software development
Golang vs Java: Programming Languages Compared and How to Choose
🌐
Turing
turing.com › blog › golang-vs-java-which-language-is-best
Golang vs. Java: What Should You Pick?
February 21, 2025 - Golang is a concurrent programming language built for modern multicore processors, meaning it can perform several tasks at once. It also features deferred garbage collection, which manages memory to run programs quickly.
🌐
Hacker News
news.ycombinator.com › item
I led our teams to switch from Java to Go because of the productivity of develop... | Hacker News
February 3, 2017 - So in my situation, the JVM is heavier by every single measure listed, and for each by a considerable margin · This is the easy trap to fall into though. What if you aggressively rewrote the Java apps from crappy legacy frameworks to well developed Java apps
🌐
Medium
charleswan111.medium.com › java-vs-golang-a-comparative-insight-into-usage-performance-and-industry-preferences-533a24013230
Java vs. Golang: A Comparative Insight into Usage, Performance, and Industry Preferences | by Charles Wan | Medium
January 21, 2025 - Golang: Designed for high-performance, it compiles directly to machine code, resulting in faster execution. Its lightweight concurrency model (goroutines) is particularly efficient for parallel processing and scalable systems.
🌐
DZone
dzone.com › coding › java › when to use go vs. java | one programmer’s take on two top languages
When to Use Go vs. Java | One Programmer’s Take on Two Top Languages
August 5, 2020 - Working at a Golang web development company has clearly shown me that Go is fast, robust, and easy to understand which makes it very good for small services and concurrent processing. For large, intricate systems, services with more complex functionality, and single-server systems, Java will hold its own among the top programming languages in the world for the time being.
Find elsewhere
🌐
BairesDev
bairesdev.com › home › blog › software development
Golang vs Java: Programming Languages Compared and How to Choose
In fact, both Java and Golang actually ... is an outstanding choice for portable, front-end applications, Golang is superior for highly-scalable backend applications....
🌐
Reddit
reddit.com › r/golang › reasons you prefer golang over java?
r/golang on Reddit: Reasons you prefer Golang over Java?
May 17, 2023 -

Background: I've been using Java for about 8 years and just started learning Golang.

So far, I'm in love with the language, and these are the top reasons:

  • More low-level control of memory. I hated how much the JVM's GC relied on the compactor. Objects can only be created on the heap and object arrays are arrays of pointers to non-contiguous locations in memory. Many like to say that Java has better GCs than Go, but that's because Go's memory model doesn't require such complicated GCs. It's also nice to have pointers in Go.

  • More paradigm-neutral. Java was designed from the beginning to be a language primarily for OO programming. Using Java for functional programming results in unnatural syntax and inefficient use of memory. Golang feels ambidextrous.

I'm still very new to Golang but as of right now, I even see it as a replacement for Node and Python in the areas of scripting and web server development. Golang's fast compile time closes makes it competitive against interpreted languages in terms of development speed, but 1-ups these languages because it gives the developer more low-level control of memory and has static typing.

🌐
YourBasic
yourbasic.org › golang › go-vs-java
Go vs. Java: 15 main differences · YourBasic Go
Go allows methods on any type; no boxing is required. The method receiver, which corresponds to this in Java, can be a direct value or a pointer.
🌐
BMC Software
bmc.com › blogs › go-vs-java
Java vs Go: What’s The Difference?
August 14, 2020 - Java is the older and more widely used programming language. It is object-oriented, has a larger community—thus library, and relies on the Java virtual machine (JVM). Go, or Golang, is newer, supports concurrency, is more readable, and is ...
🌐
Bacancy Technology
bacancytechnology.com › bacancy technology › blog › technology comparison
An Informative Guide on Golang vs Java Comparison in 2026
January 2, 2026 - Both Go and Java are C-family languages, sharing the same kind of syntax · Both are compatible to be used for server-side programming · Both possess concurrency features that allow them to execute the blocks of a program simultaneously. Golang and Java, both programming languages, have cross-platform functionality.
Top answer
1 of 4
18

(With tips from above answers, I did more test, with an additional C and V version)

On my Linux machine, with times = 100000000.

Testing result:

  • When exponent = 2.4
Copy Java: result: 1.053906e+24, during: 7432 ms
    C: result: 1.053906e+24, during: 5544 ms
   Go: result: 1.053906e+24, during: 8.716807708s
    V: result: 1.053906e+24, during: 2.342s
  • When exponent = 2, still use pow() or Pow().
Copy Java: result: 1.543194e+21, during: 630 ms
    C: result: 1.543194e+21, during: 852 ms
   Go: result: 1.543194e+21, during: 3.336549272s
    V: result: 1.543194e+21, during: 128.160ms
  • When exponent = 2, but use x * x instead.
Copy Java: result: 1.543194e+21, during: 636 ms
    C: result: 1.543194e+21, during: 340 ms
   Go: result: 1.543194e+21, during: 115.491272ms
    V: result: 1.543194e+21, during: 122.283ms

Summary:

  • In general, Go is really fast, according to the last test, faster than Java, or even C.
  • But, Java really has a good pow() implementation, according to the first two tests.
  • V, a new language similar to Go in some way, is very fast.

Code

Test.java:

Copy/**
 * Compile:
 *  javac Test.java
 * Run:
 *  java Test
 */ 
public class Test {
    public static void main(String[] args) {
        Test test = new Test();
    long startAt = System.currentTimeMillis();
        double re = test.testFun(10, 16666611, 100000000);
    long during = System.currentTimeMillis() - startAt;
        System.out.printf("%10s: result: %e, during: %d ms\n", "Java", re, during);
    }

    private double testFun(double first, double second, long times) {
        int i = 0;
        double result = 0;
        double dx = (second - first) / times;
        for (; i < times; i++) {
            result += fun(first + i * dx);
        }
        return result * dx;
    }

    private double fun(double v) {
        return v * v - v;
        // return Math.pow(v, 2) - v;
        // return Math.pow(v, 2.4) - v;
    }
}

test.c:

Copy/**
 * compile with:
 *  gcc test.c -lm
 */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>

double fun(double v) {
    return v * v - v;
    // return pow(v, 2) - v;
    // return pow(v, 2.4) - v;
}

double testFun(double first, double second, long times) {
    int i;
    double result = 0;
    double dx = (second - first) / times;
    for (i = 0; i < times; i++) {
        result += fun(first + i * dx);
    }
    return result * dx;
}

long long current_timestamp() {
    struct timeval te;
    gettimeofday(&te, NULL); // get current time
    long long milliseconds =
        te.tv_sec * 1000LL + te.tv_usec / 1000; // calculate milliseconds
    // printf("milliseconds: %lld\n", milliseconds);
    return milliseconds;
}

int main(int argc, char *argv[]) {
    long long startAt = current_timestamp();
    double re = testFun(10, 16666611, 100000000);
    long long during = current_timestamp() - startAt;
    printf("%10s: result: %e, during: %lld ms\n", "C", re, during);
    return 0;
}

test.go:

Copy/**
 * How to run:
 *  go run test.go
 */
package main

import (
    "fmt"
    "math"
    "time"
)

func main() {
    startAt := time.Now()
    result := testFun(10, 16666611, 100000000)
    during := time.Since(startAt)
    fmt.Printf("%10s: result: %e, during: %v\n", "Go", result, during)

    _ = math.Pow
}

func fun(x float64) float64 {
    return x*x - x
    // return math.Pow(x, 2) - x
    // return math.Pow(x, 2.4) - x
}

func testFun(first float64, second float64, times int) float64 {
    var i = 0
    var result float64 = 0
    var dx float64
    dx = (second - first) / float64(times)
    for ; i < times; i++ {
        result += fun(first + float64(i)*dx)
    }
    return result * dx
}

speed_v.v:

Copyimport time
import math

// compile & run with:  v -prod crun speed_v.v
fn main() {
    lang := 'V'
    start_at := time.now()
    result := run_fun(10, 16666611, 100000000)
    during := time.since(start_at)
    println('${lang}: result: ${result:.7}, during: ${during}')
}

fn fun(x f64) f64 {
    // return x * x - x
    return math.pow(x, 2) - x
    // return math.pow(x, 2.4) - x
}

fn run_fun(first f64, second f64, times int) f64 {
    mut i := 0
    mut result := 0.0
    dx := (second - first) / times
    for ; i < times; i++ {
        result += fun(first + i * dx)
    }
    return result * dx
}

Compile:

Copyjavac Test.java; gcc test.c -lm; go build test.go; v -prod speed_v.v

Run:

Copyjava Test; ./a.out ; ./test; ./speed_v

@Update - C program with -O2 or -O3 option

As suggested by Raffaello in the comment, when compiling C program, could use -O2 or -O3 to further optimize the program.

And, following are the test result for the C program:

  • When exponent = 2.4.
Copy            C: result: 1.543194e+21, during: 5805 ms
 C with `-O2`: result: 1.543194e+21, during: 5324 ms
 C with `-O3`: result: 1.543194e+21, during: 5326 ms
  • When exponent = 2, still use pow() or Pow().
Copy            C: result: 1.543194e+21, during: 897 ms
 C with `-O2`: result: 1.543194e+21, during: 119 ms
 C with `-O3`: result: 1.543194e+21, during: 121 ms
  • When exponent = 2, but use x * x instead.
Copy            C: result: 1.543194e+21, during: 353 ms
 C with `-O2`: result: 1.543194e+21, during: 122 ms
 C with `-O3`: result: 1.543194e+21, during: 119 ms

Summary - (-O2 and -O3 option):

  • With -O2 and -O3 option
    • When base is integer (e.g 2), would make c program quicker, by several times.
    • When base is floating point number (e.g 2.4), it's also quicker, but very minimal.
  • Comparing between -O2 and -O3, they are quite close in above tests.
2 of 4
12

Don't translate from another language. Write the Go version of your program in Go. For example, x*x - x,

Copypackage main

import (
    "fmt"
    "math"
    "time"
)

func main() {
    start := time.Now()
    v := testFun(10, 16666611, 1000000000)
    since := time.Since(start)
    fmt.Printf("value is %v\ntime is %v\n", v, since)
}

func fun(x float64) float64 {
    return x*x - x
}

func testFun(first float64, second float64, times int) float64 {
    sum := float64(0)
    dx := (second - first) / float64(times)
    for i := 0; i < times; i++ {
        sum += fun(first + float64(i)*dx)
    }
    return sum * dx
}

Output:

Copy$ go version
go version devel +5c11480631 Fri Aug 10 20:02:31 2018 +0000 linux/amd64
$ go run speed.go
value is 1.543194272428967e+21
time is 1.011965238s
$

What results do you get?

🌐
GeeksforGeeks
geeksforgeeks.org › java › go-vs-java
Go vs Java - GeeksforGeeks
December 4, 2025 - Developers often compare Go and Java when choosing the best language for backend development, microservices, and high-performance systems.
🌐
Shakuro
shakuro.com › blog › golang-vs-java
Golang vs Java: Developer’s Guide to Choosing the Language | Shakuro
October 21, 2024 - When it comes to concurrency, Java uses threads and the synchronization model, and it is more complex and requires more boilerplate code. With its extensive features, while powerful, Java might introduce complexity and lengthen the learning process. Generally speaking, Golang tends to be easier to use, especially for beginners, due to its simplicity and straightforward approach.
🌐
Ksolves
ksolves.com › blog › golang › comparison-with-java
Comparison Between Golang vs Java 2026
March 6, 2026 - In the ongoing Go vs Java discussions, ... in different environments. Golang is the modern, cloud-native choice, fast, lightweight, and ideal for teams that value simplicity and high performance....
🌐
Matellio -
matellio.com › home › technology › golang vs java: choosing the right language
Golang vs Java: Choosing the Right Language - Matellio
October 26, 2023 - Go (Golang): Go is known for its simplicity and minimal design. The language was developed with the goal of reducing the complexity of programming. It has a shorter syntax and fewer language features, allowing for cleaner and more maintainable code.
🌐
Netguru
netguru.com › home page › blog › golang vs java: which one to choose for your next project
Golang vs Java: Which One To Choose for Your Next Project
March 16, 2026 - Golang is praised for its simplicity, efficiency, and robust concurrency features, making it well-suited for modern backend and cloud-native applications. Java’s object-oriented design and extensive libraries ensure its versatility and reliability in enterprise applications, benefitting from a strong community and ongoing support.
🌐
Simplilearn
simplilearn.com › home › resources › software development › the supreme guide to golang vs. java
Golang vs Java: Detailed comparison | Simplilearn
November 18, 2025 - Both languages, Golang and Java come with garbage collectors and multithreading support and are renowned for their use in server-side web applications. Learn more!
Address   5851 Legacy Circle, 6th Floor, Plano, TX 75024 United States
🌐
fram^
wearefram.com › home › development team › go vs java for microservices: a developer’s in-depth performance comparison
Golang vs Java: A 2026 Guide for Microservices Teams - Fram
March 23, 2026 - At Fram, we use Golang for building lightweight, high-performance microservices due to its speed and scalability, especially for cloud-based applications (learn all about the pros and cons of cloud computing). Limited Libraries: While Go’s ecosystem is growing, it still lacks the vast library resources available in Java, which can require more time for building complex microservices.
🌐
Igmguru
igmguru.com › blog › golang-vs-java
Golang vs Java: What Should You Choose ? (Updated 2026)
2 weeks ago - Go language, more popularly referred to as Golang, was launched in 2011 by Google. It is quite similar to Java in the sense that it is a statically typed, compiled, general-purpose, and multi-paradigm programming language. This concurrent language is built basically for multicore processors.