Go is nothing but Google's teaching from Java and C++. If you're majoring in CS, the language doesn't matter that much. But if you're working with industrial code in Java, C++ or even C#, you'll notice that code complexity increases over time due to the language design: Inheritance can lead to an absolute mess. In fact, a friend of mine quit his job partly because of overused inheritance in a legacy project. This is why Go favors "composition over inheritance". Those languages confuse repetition with safety. There's literally no point of writing FileReader fileReader = new FileReader();. Go addresses this issue with type inference, less keywords and by encouraging developers to indicate the scope of a variable with its length. Sure, the other languages mentioned have type inference as well, but there are orgs where you're not allowed to use it. :-) Especially Java uses layers and layers of abstraction, mostly introduced by frameworks like Spring. This is quite handy if you have a large team that just wants to add new features without having to wrap their heads around Dependency Injection, but debugging isn't that much fun and it obfuscates the control flow. By reducing abstractions to a minimum and providing a sane standard library (removing the need for monolithic frameworks), Go tries to gain back control. Compile times of 20, 30 or even 40 minutes are nothing unheard of. It is a pain, and it is a productivity killer - so Go favors compile times of 2, 3 or 4 seconds. Rob Pike did a great talk on his intentions when designing Go: "Public, Static, Void" Answer from dominik-braun on reddit.com
🌐
Reddit
reddit.com › r/golang › what's the advantage of golang instead of java or c# in industry?
r/golang on Reddit: what's the advantage of golang instead of java or C# in industry?
March 18, 2021 -

I'm a student majoring in in CS and I'm interested in golang and learn it a little bit but I don't know what's the real advantage of it.

I think C# or java has better a framework now (for example Spring in java) and speed is fast enough.

and golang's orm isn't good so far.

If you guys work for company and use golang now, I want to know why you choose it.

** recently golang is frequently used in blockchain instead of C++. why?

Top answer
1 of 28
218
Go is nothing but Google's teaching from Java and C++. If you're majoring in CS, the language doesn't matter that much. But if you're working with industrial code in Java, C++ or even C#, you'll notice that code complexity increases over time due to the language design: Inheritance can lead to an absolute mess. In fact, a friend of mine quit his job partly because of overused inheritance in a legacy project. This is why Go favors "composition over inheritance". Those languages confuse repetition with safety. There's literally no point of writing FileReader fileReader = new FileReader();. Go addresses this issue with type inference, less keywords and by encouraging developers to indicate the scope of a variable with its length. Sure, the other languages mentioned have type inference as well, but there are orgs where you're not allowed to use it. :-) Especially Java uses layers and layers of abstraction, mostly introduced by frameworks like Spring. This is quite handy if you have a large team that just wants to add new features without having to wrap their heads around Dependency Injection, but debugging isn't that much fun and it obfuscates the control flow. By reducing abstractions to a minimum and providing a sane standard library (removing the need for monolithic frameworks), Go tries to gain back control. Compile times of 20, 30 or even 40 minutes are nothing unheard of. It is a pain, and it is a productivity killer - so Go favors compile times of 2, 3 or 4 seconds. Rob Pike did a great talk on his intentions when designing Go: "Public, Static, Void"
2 of 28
76
In my opinion, the major selling point of Go vs. Java and C# is running cost. Let me explain further in points form: Go consume very minimal memory. My web service run about 10MB to 20MB max. I can just use the cheapest VM available, e.g. 3.5USD AWS Lightsail and still have the resource to run other things in the same VM. This is one of the reason why Go is very popular in third world country like Indonesia and China because they can save a lot of money. At the same time, Go benchmark usually tops C# and Java (except against vert.x). Simple concurrency model that most people can understand. You don't have to hire experienced .NET or Java developer to maintain your code. Go build very fast, so if you're using build agents (e.g. Azure Dev-ooops), your build agent running cost will be very low and you don't have to deploy VM with crazy spec to back your build agent. Also, tests usually complete significantly faster compare to the equivalent Java/C# project, which again further reduce the cost of your build infrastructure. In summary, I'm poor and Go is the best tool for poor people like me without having to go through the pain of learning C++/Rust.
🌐
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.

Top answer
1 of 62
267
Super reliable runtime. It's extremely rare that we have to go back in the code and fix it up due to instability or performance reasons. Huge savings on RAM. Java eats memory like it's a cookie monster, which is a huge cost driver for us on EKS (we do a lot of data streaming, and the difference is night and day) Much eaiser for developers to run "the entire stack" locally on their machine. You can easily spin up a docker compose with say 10 microservices in go, no problem. With java services that always gets tricky, whether it's due to RAM or sluggishness or dependency issues Very easy for a team to collaborate on a project. You can just read the code, understand what it does and jump in to add features very easily. No need to digest an entire object inheritance graph. No need to search for the AbstractFactoryExecutorBean that actually **does the thing**. Very easy for anyone to just clone a project and start running tests, or run the whole project. Our JVM projects always have a ~30min to ~4hour startup time of "oh you have the wrong JDK on the path" or "Maven HTTP 401 Unauthorized", or "maven has installed the wrong version before you had to swap our the jdk for 1.8". The difference to golang is stark and very time saving in this respect. On the flip side, the JVM shines for big data processing. The type system is just much more advanced. And the runtime is more flexible in many ways. There's no "flink"/"spark" for golang. Yet.
2 of 62
256
No maven/gradle, no spring framework, fast start up time.
🌐
Reddit
reddit.com › r/golang › go vs java
r/golang on Reddit: Go vs Java
August 12, 2024 -

So i am a python backend dev(mainly using fastAPI) but for scaling backends this is not ideal. I also know the basics of Java and Spring, but tbh i do not like coding in java. So my question as a dev who mainly uses Python and TypeScript is if Go could be the best fit for my use case and if so which of the Frameworks is the most similar to FastAPI?

Thanks for your help.

🌐
Reddit
reddit.com › r/golang › what go does better than java and reverse from your experience?
r/golang on Reddit: What Go does better than Java and reverse from your experience?
May 1, 2017 -

I've started to learn Java mainly because Android development is based on it. I'm not really familliar with it, but I've a c++ background that might give me some ideas. What I'm really looking to know is where I should use Java instead of Go. There's some fields below that I'm interested in and wanna hear your opinions as well:

a) Mobile Development

b) Web Development

c) Games Development

d) Scientific Development

e) GUI Development

f) New field..

If you're familliar with both languages and wanna give me your opinion would be awesome!

Note that I'm not looking to switch or give up one language in favor of another, but wanna learn to use them where they fits the best.

🌐
Reddit
reddit.com › r/golang › i know java, should i learn golang too?
r/golang on Reddit: I know Java, should I learn Golang too?
January 22, 2024 -

Hi guys 👋, I’m a SE student currently doing a personal project. I know Spring boot/Java/Kotlin and pretty happy with it. However I see Golang is kinda interesting and beside it have pros over Java like:

  • low ram consume

  • compile to single binary file

  • fast (nearly same as java)

  • goroutine

  • good for cli app (github cli)

But I saw some people (not in r/java, trust me) said that we don’t need to learn Golang anymore because of Java virtual thread. Some people said that the performance between Java and Golang is nearly no difference, Java for monolith big app, golang for microservice/small rest app. Learn Rust instead of Go

So my question is, Is it worth learning Golang or just “All in” Java? Any benefits in learning Golang for Java/Backend developer? I want to hear you opinions ❤️

Btw, I’m good at Java, Kotlin, Dart, Python, (also know JS/TS but not proficient)

This question has been asked in r/java

Sorry if I said anything wrong. Thank you, have a great day 🙏 ❤️

EDIT: I want to learn Go because of the job opportunities (1/4 compare to Java) 🥲

🌐
Reddit
reddit.com › r/golang › have you moved from java to go (or another popular language).
r/golang on Reddit: Have you moved from Java to Go (or another popular language).
October 17, 2022 -

I am with the opportunity to make a move (not a project within my company, a proper move to a go based role/company) from Java o Go.

I have worked with go before in some small projects in my company (mostly kubernetes focused), and I enjoyed, but was never “full time” or for long periods , it’s always have been a kind of “pet project” language for me.

So my question here is, have you made similar move, do you regret, do you miss the Java verbosity at all? What abou the ecosystem do you miss the nice java frameworks, do you have fun or would go back if you could?

Thanks

🌐
Reddit
reddit.com › r/golang › have worked with java for several years, picked up go roughly a month ago, absolutely love it
r/golang on Reddit: Have worked with Java for several years, picked up Go roughly a month ago, ABSOLUTELY LOVE IT
July 19, 2024 -

I cannot stress enough how much I prefer working with Go compared to Java. It's clean, simple, and, it's fun! No more factory design pattern, no more hundred lines of getters and setters, and no more shitty annotations. It all just makes sense.

When I first started, I did a lot of reading about avoiding "Writing Java code with Go". My dad was an engineer in the 80s-00s who was a very very early adopter of Java (I have more Java & OO books than you can imagine). So, it was definitely a challenge stepping back and reevaluating how I would approach a problem compared to before. Go's interface system, as an example, was extremely confusing compared to how Java does it (tho, I'm definitely a fan now of Go's). If you have any prior experience with C, you'll definitely find it much easier to transition to the language.

Lastly, just want to say thank you to the Go community! You all have been so helpful with any dumb questions I've had :)

Note: To anyone new to Go that's reading this, be sure to go through "Go by Example", Go Docs, and "Effective Go" (also recommend Go's style guide: https://google.github.io/styleguide/go/best-practices). Really helped me with getting up to speed quickly (will be going through Go's specification soon).

Find elsewhere
🌐
Reddit
reddit.com › r/golang › from go to java
r/golang on Reddit: From Go to Java
July 26, 2023 -

Hello,

My background is working with Go on microservices ~3 years total xp and I got a better offer (60% more) for a Java role.

The Java role seems interesting due to the $ (obviously), but also due to the nature of the scale and amount of data that I will be working with, which for my current role are not met.

I don’t want to fall into the trap of getting attached to a language or tool, but I love Go and its ecosystem. This change seems quite big, but I want to become better as a software engineer, not an expert on "x" tool.

Can practices from Go be transferred to Java, as I know the approaches are quite different? I don’t want to get opinionated and think that there is only one good way to do things.

Any opinions or feedback on this and how it can impact my career is appreciated.

🌐
Reddit
reddit.com › r/java › java performance vs go
r/java on Reddit: Java performance vs go
December 9, 2025 -

I'm seeing recurring claims about exceptional JVM performance, especially when contrasted with languages like Go, and I've been trying to understand how these narratives form in the community.

In many public benchmarks, Go comes out ahead in certain categories, despite the JVM’s reputation for aggressive optimization and mature JIT technology. On the other hand, Java dominates in long-running, throughput-heavy workloads. The contrast between reputation and published results seems worth examining.

A recurring question is how much weight different benchmarks should have when evaluating these systems. Some emphasize microbenchmarks, others highlight real-world workloads, and some argue that the JVM only shows its strengths under specific conditions such as long warm-up phases or complex allocation patterns.

Rather than asking for tutorials or explanations, I’m interested in opening a discussion about how the Java community evaluates performance claims today — e.g., which benchmark suites are generally regarded as meaningful, what workloads best showcase JVM characteristics, and how people interpret comparisons with languages like Go.

Curious how others in the ecosystem view these considerations and what trends you’ve observed in recent years.

🌐
Reddit
reddit.com › r/golang › advice on moving from java to golang.
r/golang on Reddit: Advice on moving from Java to Golang.
April 3, 2025 -

I've been using Java with Spring to implement microservices for over five years. Recently, I needed to create a new service with extremely high performance requirements. To achieve this level of performance in Java involves several optimizations, such as using Java 21+ with Virtual Threads or adopting a reactive web framework and replace JVM with GraalVM with ahead of time compiler.

Given these considerations, I started wondering whether it might be better to build this new service in Golang, which provides many of these capabilities by default. I built a small POC project using Golang. I chose the Gin web framework for handling HTTP requests and GORM for database interactions, and overall, it has worked quite well.

However, one challenge I encountered was dependency management, particularly in terms of Singleton and Dependency Injection (DI), which are straightforward in Java. From my research, there's a lot of debate in the Golang community about whether DI frameworks like Wire are necessary at all. Many argue that dependencies should simply be injected manually rather than relying on a library.

Currently, I'm following a manual injection approach Here's an example of my setup:

func main() {
    var (
        sql    = SqlOrderPersistence{}
        mq     = RabbitMqMessageBroker{}
        app    = OrderApplication{}
        apiKey = "123456"
    )

    app.Inject(sql, mq)

    con := OrderController{}
    con.Inject(app)

    CreateServer().
        WithMiddleware(protected).
        WithRoutes(con).
        WithConfig(ServerConfig{
            Port: 8080,
        }).
        Start()
}

I'm still unsure about the best practice for dependency management in Golang. Additionally, as someone coming from a Java-based background, do you have any advice on adapting to Golang's ecosystem and best practices? I'd really appreciate any insights.

Thanks in advance!

Top answer
1 of 5
213
There's a saying "Java programmers can write Java in any language". I believe you already understand the tension here. Continue on your enlightening path and reassess these "best practices" that are really "Java-specific best practices". Good luck!
2 of 5
37
I think DI and inversion of control is also key in go, but it's simply done differently. I come from nestjs (nodejs) which is really similar to springboot, so I think I had to make a similar transition. First I tried some fancy lib/framework to get DI based on modules like it's done in spring, but that didn't work very well. Then I figured out I just needed to make my services depend on interfaces and inject them a super simplified example (using gorilla mux + core http): I have an endpoint for auth (login and such): func login(userAuth user.AuthService) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { // ... do stuff to make login happen } } This endpoint depends on a service, deinfed in my user module (user.AuthService): type AuthService interface { Login(params LoginParams) (*LoginResult, error) } in the module where the endpoint is defined I have a function to handle all endpoints, which asks for all the dependencies (still interfaces of course) func Handle(router *mux.Router, userAuth user.AuthService) { router.Handle("/auth/login", login(userAuth)).Methods("POST", "OPTIONS") } To wire things up, in my main I instantiate that user.AuthService with the implementation (only know by name, my endpoint won't care) conf, err := config.Parse() if err != nil { log.Fatal().Err(fmt.Errorf("load config: %v", err)).Msg("") return } cacheService, err := cache.New(&conf.Redis) if err != nil { log.Fatal().Err(fmt.Errorf("load cache: %v", err)).Msg("") return } db, err := mongo.New(&conf.Mongo) if err != nil { log.Fatal().Err(fmt.Errorf("load mongo: %v", err)).Msg("") return } jwtService := jwt.New(conf.JWT) userRepository := usermod.NewRepository(db) userAuthService := usermod.NewAuthService(userRepository, cacheService, jwtService) router := mux.NewRouter() auth.Handle(router, userAuthService) So far this is working pretty well for me: you still depend on interfaces main is the only one that knows the implementations and injects them following the interfaces. No fancy modules and dependency graph resolvers, but that's for the best -> aiming for simplicity
🌐
Reddit
reddit.com › r/golang › go vs java. a side-by-side comparison of code snippets that showcase syntax differences.
r/golang on Reddit: Go vs Java. A side-by-side comparison of code snippets that showcase syntax differences.
January 29, 2020 - Decided to make my own version for GoLang and Java comparison. I have plans to frequently update and add new snippets as my knowledge of Go progresses. I'm open for your comments and contribution. If you want, you can fork it on GitHub: https://github.com/adikm/golang-vs-java
🌐
Reddit
reddit.com › r/experienceddevs › java vs golang
r/ExperiencedDevs on Reddit: Java vs GoLang
October 24, 2024 -

Hello experienced dev community,

I have 6 years of front end experience at big tech, start ups, as well the bank.

I want to transition into full stack or backend development , therefore I will be starting to learning backend tech stacks outside of work hours.

My friends suggested either Java + spring or GoLang. Apparently Java has the most mature platform and best overall supported ecosystem. As well, from landing a job perspective, most enterprise uses Java. However, he said golang is getting popular and the golang community is very motivated, although Go is utilized to write dev op tools like Terraform.

My goal is to intensively study and build a decent backend heavy project and hopefully transition into full stack / backend developer roles in 6 months.

Should I start go all in on Java?

🌐
Reddit
reddit.com › r/golang › need to learn a backend language. which should i learn, java or go?
r/golang on Reddit: Need to learn a backend language. Which should I learn, Java or Go?
May 20, 2018 -

Need advice from senior developers in this group. I am currently working as a full-stack JS developer and am currently looking to learn a backend language and cannot decide between Java and Go.

My goal is to eventually work on highly scalable distributed systems. So which language should I learn keeping in consideration the job market and my goal to build scalable systems? Java or Go?

Note:- I am currently based in India and would soon be moving to Toronto, Canada.

Please elucidate with reasoning. thanks!

🌐
Reddit
reddit.com › r/java › from java to golang and back
r/java on Reddit: From Java to Golang and back
October 5, 2022 -

Hi folks!

Small disclaimer: I have 11 years of experience as software engineer. Started with Java (web services) and after some time (5-6 years) decided to switch to mobile development(iOS + Swift). On that time the last actual version of Java was 1.8 ver. Now, after a while I want to switch back to backend development and from here and there I read about comparisons between Java and Golang. I know what are the differences between them and understand, that there is some hype behind the Golang. I tried Golang for 2-3 month and I have some feelings, that in some aspects it's not a language for my taste. But now I just curious do anybody have an experience with switching from Java to Golang and back to Java. What were your reasons? What you didn't like in Golang.

🌐
Reddit
reddit.com › r/golang › how does go perform in comparison to .net, java or php in terms of web dev?
How does Go perform in comparison to .NET, Java or PHP in terms of web dev? : r/golang
February 27, 2023 - I have REST APIs (and GraphQL) ... Go, Java, Python, and Ruby. There are some aspects of Go I really like: compiled standalone, error model, no frameworks, no OOP, etc. There are also some drawbacks if you need to deal with dynamic data (XML, nested JSON, data which can have multiple shapes). It can become very tedious dealing with complex data especially if you have to implement your own marshalers. ... I've used tools like https://mholt.github.io/json-to-go/ ...
🌐
Reddit
reddit.com › r/golang › go vs java: decoding billions of integers per second
r/golang on Reddit: Go vs Java: Decoding Billions of Integers Per Second
November 16, 2013 - Thanks dgryski on reddit and minux on the golang-nuts mailing list. More replies ... The areas I know are taking most of the execution time are functions like nlz1a (number of leading zeros) and DeltaMaxBits, in here (https://github.com/reducedb/encoding/blob/master/util.go).