DEV Community


what's the advantage of golang instead of java or C# ?

jones268 profile image jones268 ・2 min read

There are a few reasons why I prefer Go over Java and C#, not least of which is the standard library. You can install plenty of packages to do almost anything you want, but Go's standard library is minimalistic and very readable (what is golang?).

The big advantage of golang is that the code is less verbose and easier to read and write. The syntax is easier than java, and borrowing some syntax from python make it more natural for me than C#.

package main

import "fmt"

func main() {
    fmt.Println("Hello World!")
Enter fullscreen mode Exit fullscreen mode

What is Go?

Go is a programming language (golang) with a culture that is growing out of the love for software tooling. I'll say that again. Go was built from ground up with the singular purpose of creating an ecosystem of reusable tooling that serves as the foundation for the language itself.

Go is a language that is powerful enough to be the foundation of such things as the Docker system, but simple enough that you can learn it quickly.

Why Go?

To be honest, the real reason I start to use golang is that it's supported by Heroku (and has a free tier) and DigitalOcean (not free). That make it very easy to try, with almost no cost.

If you try go in production, you'll probably have a little cost. At least it's possible to pay 0 if you're lucky (0$/month and 0$/hour for its free plan) and that's great.

Go is also very easy to learn if you know another language such as java or C#.

Go is really focused on back-end development. For front-end you can use something like Angular or Vue

Discussion (2)

Editor guide
ahferroin7 profile image
Austin S. Hemmelgarn

There’s another huge advantage to Go over C# and Java that I often do not see mentioned: It does not require a special runtime on the target system.

Java needs a JVM install, C# needs a CLR install (usually .NET, sometimes Mono), but if you build things right, Go needs absolutely nothing beyond the basic OS.

patarapolw profile image
Pacharapol Withayasakpunt

You can use a Dockerfile in Heroku as well. No need for buildpacks.