Why Do People Use Go ?

ยท ยท 738 words ยท 4 minute read

People use Go programming language For various reasons. Here is all reasons in brief:

Gopher writing code

  1. Go is open-source but backed up by a large corporation (Google)

  2. Itโ€™s fast:

  • to learn
  • to build up
  • to compile
  • to arrange and install
  • to scamper
  1. Go is a modern language

  2. Go is Simple

  3. It is Concurrent

  4. Static code analysis

  5. Garbage collected language

  6. Testing Support

And now, let’s dive in each reason.

Performance ๐Ÿ”—

Most people come to Go from dynamic languages like Ruby , Python , JavaScript , PHP and similar. Usually, the main reason for the switch is performance and memory efficiency. Go is one of the most efficient languages at this time which is also relatively easy to pick up and get productive with quickly. Itโ€™s far from the most efficient ones but itโ€™s probably one of the best when it comes to the balance between performance and convenience.

Concurrency ๐Ÿ”—

Concurrency has become one of toughest problems of modern programming, especially when it comes to networking software. Go was designed with concurrency and multi-core systems in mind. Itโ€™s not a revolution in concurrent programming but Goroutines and channels make concurrency way easier to handle! People coming from single-threaded environments are advised to learn the basic concepts of multi-threaded programming (data races, locks, lock-contention, lock-free structures, etc.) before even touching goroutines but they usually pick it up relatively quickly with Go because you usually canโ€™t even get around it.

Simplicity and consistency as core language features ๐Ÿ”—

Go was designed to avoid hidden complexity and keep code consistent and straightforward. Iโ€™ve seen people ditch large C++ codebases and rewrite the whole thing in Go because the C++ code became unmaintainable at some point while Go code tends to remain maintainable over time at a very slight cost of runtime performance (compared to C++ ). Itโ€™s very common for people who initially started a thing to leave the company afterward and this can sometimes be a serious problem for codebases written in languages like C++ because of the diversity of these kinds of ecosystems. Go is a rather conservative language when it comes to features, code-style, and syntax-sugar making it one of the easiest languages to maintain codebases in.

  • No hidden complexity (no operator overloading, no function overloading, no setter/getter magic, no preprocessor, no const-expressions, no JIT-compilation, no abstract data-types, no implementation-inheritance, .. etc.)

  • No generics (Donโ€™t get me wrong, generics arenโ€™t bad, theyโ€™re actually pretty useful in some cases but their absence does make code more simple often than not)

  • A consistent code-style across the entire ecosystem ( gofmt )

  • Strong static typing (IMHO, strong static typing makes code simpler because it makes violating constraints rather difficult making code easier to read, test, change and refactor)

Tooling ๐Ÿ”—

A programming language needs more than just a good design and a good compiler to be able to become relevant in the market. The toolset is essential to make a language successful and give people enough confidence to write production-grade stuff in it. Go comes with an excellent set of tools right out-of-the-box:

Trustworthy Backers ๐Ÿ”—

The fact that Go is not just designed and implemented by honored people like Ken Thompson but also backed and used by Google makes it easier to convince businesses to use Go in production. Go 1 keeps the backward compatibility promise and takes it seriously which makes it suitable for production-grade code.

Ecosystem & Community ๐Ÿ”—

Thereโ€™s a list of companies using Go but I think even though itโ€™s relatively well maintained itโ€™s still far from complete. The number of Go developers around the world is counted in millions and Goโ€™s ecosystem is steadily growing . Thereโ€™s plenty of material to make it easier for people to get started with Go like the Tour of Go , Go by Example and similar.

Fewer mistakes ๐Ÿ”—

Most errors occur in unverified or complex code. Go provides convenient tools for testing. In addition, strict typing eliminates errors like a random comparison of the number of apples with the number of pears, which are determined at the compilation stage.