DEV Community

Pavan Belagatti
Pavan Belagatti

Posted on • Edited on

Why is Go so Damn Popular Among Developers

Go, which is also known as Golang, is a compiled language, fast and high-performance language intended to be simple and is designed to be easy to read and understand. Go was created at Google by Rob Pike, Robert Griesemer, and Ken Thompson, and it first appeared in Nov 2009.
The syntax of Golang is designed to be highly clean and accessible.

Introduction to Go

Go was invented in 2007 at such a time when multicore CPU architectures were common everywhere, and no programming language simplified the development of multithreaded applications. The responsibility of managing different threads safely and efficiently was a huge responsibility on developers. Go is different from other languages; it is young yet so powerful.
Goroutines revolutionized competitive programming on the other level.
Alt Text

It is tested and proved that applications that are written on Go are highly performant and scalable. Golang is a very efficient language, just like C/C++, handling parallelisms like Java, and has easy code readability like Python and pearl. Golang has indisputable architectural advantages over its predecessors.

Go is used by some of the big brands such as BBC, Uber, Novartis, Basecamp, and Soundcloud. Uber has reported better throughput, high performance, latency, and uptime. BBC, the house name in broadcasting the world news, uses it for backend, including crawlers and web scrapers. The build and deployment system of Soundcloud is in Go.

Below is the Google trends overview of the Go programming language. It is up and growing steadily.

Alt Text

Why Go?

It is effortless to learn for programmers with C++ experience, and also converting legacy code to Go is pretty straightforward and fairly simple. Being a compiled, statically typed language, it’s much faster than interpreted options and also offers most of the performance benefits.

Most loved,
Alt Text

Most wanted,
Alt Text

  • Go fits really well for general performance-oriented cloud software. The popular DevOps tools are written in Go, such as Docker, and even the open-source container orchestration system Kubernetes is built on go. Vitess, a Google built distributed database system and a MySQL backend built with Golang, has been in use by YouTube since 2011.

  • Golang ranked in the 5th position in the Stack Overflow Survey that was conducted in 2018. According to the Q2 GitHub report in 2018, Golang had a growth rate of almost 7% overall with a 1.5 change from the previous Quarter. And by Q4 of 2019, Golang has grown to an 8% overall increase.

Reasons why Go is so popular

  • Go is a statically typed, compiled language; hence you can easily catch problems early on.

  • Go compiles instantly to machine code, so it makes the edit/refresh cycle relatively fast, and still reasonably efficient machine code is produced.

  • Go is designed in such a way that it makes it easy to write highly concurrent, networked programs.

  • Go comes with a lot of built-in infrastructure to support testing; you can effortlessly define and test modules; this further strengthens engineering discipline.

  • Go's cross-platform hallmarks make porting code very easy, and this is the most significant advantage of Go.

  • Go gives opinionated formatting, linting & vet tool as a default part of the package, and the Go compiler even enforces things like unused variables. This makes it a professional language.

  • Go's native support for concurrency and parallelism is what makes it so special. This makes Go a perfect language for applications that require heavy concurrent and/or parallel processing, networking, massive computing, etc.

  • Go is the best for cloud compatibility. Go is featured with a better garbage collection facility, good network package & solving the problem of unused variables, multi and cross-culture compilers.

Let us see some practical cases on who else is using Go and why

SendGrid moved to Go

SendGrid, a customer communication platform, decided to move to Go as its primary development language long back in 2014. The SendGrid team needed to make a fundamental shift in their development language, and it boiled down to a competition between Scala, Java, and Go.

The biggest challenge that SendGrid faced in development then was concurrent programming. Having the idea of concurrent asynchronous programming as part of the language was one of the most compelling reasons why Go was chosen at SendGrid.
read the full story at their own blog 'How to convince your company to go with Golang'

Hexac switched from Python to Go

Tigran Bayburtsyan, the Co-Founder and CTO at Hexac, writes an exclusive article where he shares why his company moved from Python to Go. Based on their code base statistics, after rewriting all their projects in Go, they got 64% less code than they had earlier.
They saved a lot of resources (Memory, CPU) because of the built-in language features of Go.

Go gave their development team huge flexibility, single language for all use cases, and for all of them, it worked very well. At Hexact Inc, they got about 30% more performance on their backend and API services. Now they can handle logging real-time, transfer it to database and make streaming with Websocket from single or multiple services. This is an outstanding outcome from using Go language features.

Salesforce ditched Python for Go

Before launching Einstein Analytics in 2017, Salesforce renewed the backend and entirely rebuilt it on Google's popular Go language.
Salesforce principal architect Guillaume Le Stum stated that 'Python fails to do multi-threading really well, while Go, is built for heavy applications suitable for Google's production systems, the language has been tested and approved by Google, so Salesforce chose to shift Einstein Analytics, the vital part of Salesforce, from a hybrid C-Python application to a completely Go application. Read the original article here, 'Salesforce ditched Python for Google's Go language in Einstein Analytics'

Containerum chose Go over others

Containerum, a container management platform been using Go as their primary language for about four years now, and despite certain challenges, the engineering team thinks it is a good choice. The main reason to choose Go at Containerum Platform is because it consists of a group of smaller services which communicate with other components of the system. To ensure this, it is highly necessary to secure interface compatibility and write code that is too simple, easy to read, and maintain.
Go enables adding patches and allows using ready components in the code base, e.g., image names parsing validation, key object models, etc. and this is one of the reasons Containerum chose Go.
Containerum considered Go over other languages because of its many Pro features/facts such as static typing, minimalism, standard library, fantastic performance, super-fast compilation, and much more.

Read the full story here, 'Why we use Go to develop Containerum platform for Kubernetes.'

Popular DevOps tools are written in Go

Kubernetes, Docker and Istio

The giant company Google considered writing Kubernetes in other languages, including but according to Joe Beda, co-founder of Kubernetes, none of these languages were as effective as Go. There were many reasons why Kubernetes is written in Go. Some of them include - great libraries, fast tools, built-in concurrency, garbage collection, type safety, etc. According to Joe, the patterns and tools in Go have encouraged the Kubernetes team to make well-factored and reusable code that will give them both a high degree of flexibility and velocity at the same time.

Docker has been the biggest user of Go. The team at Docker liked Go because it offered them many benefits: static compilation with no dependencies, neutral language, a full development environment, extensive strong standard library, and data types, strong duck typing, and the ability to build for multiple architectures with minimal nuisance.

Istio, part of the Kubernetes ecosystem, is also written in Go.
Since Kubernetes was also written in Go, it was a perfect approach for Istio to write in Go. That is not just one reason, among many, Go’s suitability for decentralized, distributed networking projects was one of the main reasons to choose Go at Istio.
See more at ‘10 open-source projects proving the power of Google Go

If you’re programming your applications in GoLang, how hard is it to practice CI/CD? Pretty hard, isn't it?

Well, not now. With the latest innovations in Go, like Go Center GOPROXY, the path to quality CI/CD is much clearer. GoCenter is a central public collection for immutable Go modules. It allows you to search for modules and versions, also you can easily add your own modules to it to be shared publicly.

Top comments (11)

Collapse
 
lukaszwiktor profile image
Łukasz Wiktor • Edited

I don't think that Go is really that popular. Sure, it's getting more popular, but when you compare it to Python on Google Trends then Go is below 10%

Go vs Python - Google Trends

trends.google.com/trends/explore/T...

Collapse
 
pavanbelagatti profile image
Pavan Belagatti

Google trends is just one metric to compare the search volume and that does not necessarily show the actual popularity. I agree, every language has its place today but when it comes to Go, all I meant is, by relative terms, this language has more to give to the DevOps world. That is one reason why most of the popular DevOps tools like Docker, Kubernetes, Terraform, etc are written in Go.

Collapse
 
petros0 profile image
Petros Stergioulas • Edited

I agree with @Łukasz, it is not so popular. But is nice if you want it for DevOps. I would consider it the best together with Rust.

But I find it a pain in the ... writting Web Apps with it. It doesn't have the solutions that Java and Node.js offer.

Collapse
 
totallygamerjet profile image
TotallyGamerJet

If you want to utilize Node.js you can use GopherJS which compiles Go into JavaScript and provide interfaces for calling into JavaScript libraries.

Collapse
 
nikolaykhodov profile image
Nikolay Khodov • Edited

GopherJS doesn't compile but rather transpile.

Transpilation doesn't bring run-time safety and may sometimes generate inconsistent code which can't be debugged w/o deep node.js knowledge.

I also think you can't enjoy all power and performance given by goroutines. The JS runtime is different from what you're used to.

I would think twice to use GopherJS. The other alternative is to really compile into WebAssembly modules with exposed APIs that give you the run-time safety, predictability, portability. node.js natively supports WASM modules.

Collapse
 
petros0 profile image
Petros Stergioulas

Why should one do this? It doesn't worth the hassle.

Thread Thread
 
totallygamerjet profile image
TotallyGamerJet

Well, there are a couple of reasons. First, if you've never used JavaScript and don't fully understand how it works you can use a more familiar language like Go. Second, you can use the entire std library including Go's very strong http support. Third, you can use go routines and channels for easy multiprocessor computation. Fourth, and in my opinion most importantly, Go provides safeties and creates less error prone code. There are probably a ton of other reasons but those are just a few.

Thread Thread
 
petros0 profile image
Petros Stergioulas

The effort you will put on doing this, you can just learn typescript (which really similar to Go).

Well, about the goroutines. Rxjs. Not the same but powerful.

Sorry but I am using on daily basis Go. Sometimes is really frustrating 😂

Collapse
 
donvitocodes profile image
donvitocodes • Edited

I still see very less compaines using Go for backend services of their business applications. I observe job postings at least here in SEA and compaines mostly use it for DevOps tooling. Could be a chicken and egg problem, maybe they also see there is scarcity of Go developers and companies don’t want to take the risk.

Collapse
 
in_california_ profile image
Ray Barboni

I stopped reading this article when it said 'Pearl' was readable

Collapse
 
koshqua profile image
Koshqua

Actually, it's "Go", which is also known as "Golang".