DEV Community

Cover image for Why you should learn Go?
Lucas Gabriel Sánchez for Cloud(x);

Posted on • Updated on

Why you should learn Go?

I can already hear you: Another programming language? WHY?!

There are already more than 650 programming languages.

Maybe you already know a few of them and can read and write one or two with great ease. Then if you can do X in Y programming language, why do you need to learn to do it in Go? To start answer that I will tell you a story, my story.

When I began my journey to become a programmer I wanted to know: What were the languages used in the wild?. I only knew Visual Basic, but didn't have any clue that almost nobody was using it in production. After a few months I discovered one programming language was dominating: Java. At that point I set the goal to learn Java and so I did.

I learned about object oriented programming and design patterns to understand Java. Also learned about classes and interfaces, about virtual methods and packages. The language was an excuse to learn a lot of theory about how to develop applications.

The Go Programming Language
Since then I learned Pascal, Python, C, C++, C#, Erlang, ActionScript, JavaScript and Go. Every language had its own rules and quirks but a lot of them have the same principles and foundations. How many languages you know that use classes to define objects? How many languages use methods and the concept of "this" to refer to the object that receives the method call?

Later, a wise programmer told me: "The only programming languages worth learning are the ones that can teach you something new". Some languages taught me something new, but not all of them.

Some may say that learning Pascal or Erlang is not a good move in 2021, but they taught me things that I didn't know before.

From Erlang I learned the philosophy of its creators: "fail fast and fail loud". To have a resilient system, you should fail fast and loud so other parts of the system can do something about it.

From Python I learned that simple is better than complex. Explicit is better than implicit. Among other things

From C I learned that with great power comes great responsibility.

So, here are my 2 cents: Learn at least one programming language that's not your main one and use it. Expand you horizons, learn something new, learn Go. It will make you a better programmer.

Go is not the first language to implement some of its features but is the first to have them implemented well. Companies (and people) are using Go in production, in software that is changing the world. Some features present in Go that I didn't see in any other language until now are:

  • Concurrent primitives instead of threads or callbacks
  • Error values instead of exceptions and try/catch
  • Object orientation without classes nor inheritance
  • First class testing support
  • Deferred execution

Go also shares features with other programming languages, but implemented in different ways. Those ways let you see the world from a different perspective. A better perspective.

Those features are:

  • Interfaces: my favourite feature of Go.
  • It's open source
  • The Go 1 compatibility promise: Go 1 programs will always compile.
  • Type inference: in a statically typed language this is pure gold.
  • Compiled to machine code: it doesn't run in an interpreter or virtual machine, it runs fast and use less resources than others.
  • Fast compile times: you can compile several thousand of files into a single executable file in less than a second.
  • Garbage collected: you don't have to manage memory by hand.
  • Ease of use: tools such as "go build", "go test" and "go get" simplify the development cycle

If you learn Go you will acquire a different mindset. You will learn something new. You will see the world from a different perspective and that in itself can be a great thing for you and your career. No matter what language you use in 5 or 10 years from now.

Top comments (0)