2023-08-16

Go – The Language of the Future

In 2007, three of Google’s engineers – Robert Griesemer, Rob Pike, and Ken Thompson – were so infuriated at what they saw as avoidable challenges posed by the development languages of the day, that they decided enough was enough, and Go was born.

Two years later, Go was released as an open-source platform by Google and quickly gathered momentum with the help of their community-driven development. In no time at all, they were ready to release their first reliably stable iteration to the market, which opened all sorts of possibilities for production teams across the world.

It will come as no surprise, perhaps, that Google were quick to adopt the language into many of its projects from then on, but they were not alone. Other large tech companies, including the likes of Docker and Cloudflare followed suit, and this only served to boost the mass appeal of the exciting new language, leading to the creation and development of a raft of libraries, frameworks, and tools.

Robert Griesemer
Rob Pike
Ken Thompson

The Power of Concurrency

The main issue that Griesemer, Pike, and Thornton encountered when it came to the development languages being used at Google, was that they made concurrent development very difficult to achieve.

You might imagine the development of a program as a series of orders that are executed one after another, in quick succession, to bring about an ultimate result. Well, the idea of “Concurrency” in the programming world, is that a platform or program can be designed to run its tasks in any order and still achieve the same result as traditional sequential tasks.

Go was one of the first languages to be designed with concurrency expressly in mind, and the development of Goroutines was one of the key points to its success. Goroutines are seen as one of the fundamental building blocks for concurrency in Go, and they benefit the developer greatly by being lightweight and efficient. Put simply, you could have tens of thousands of Goroutines working simultaneously and notice extremely little difference in terms of program performance. In short, the Go creators had struck concurrency gold.

Goroutines now allowed developers to create responsive programs more easily, and the positive effect on the scalability potential for Go platforms was immense. Creating a Goroutine is as simple as adding “go” before your function call, so as workload increases, you can dynamically create more Goroutines to help handle the load. One of the great features of the Goroutine is that they will communicate with each other through channels that allow the safe exchange of data and messages without the need for any intricate lock or synchronisation methods.

Delivering Success on Demand

There are many apps that people might think of as “everyday” in their lives, but some of the biggest have utilised the dynamism and scalability of Go to produce brilliant offerings for their customers. Very few of them are quite as big as the global ride-sharing and delivery platform, Uber.

It is no exaggeration to claim that, without the use of Go in their app, Uber just wouldn’t be able to compete with the other big players in the industry. You see, they used it to create their “geofence” program. The idea behind this piece of software is that the app would be able to precisely define the location of the customer, apply special delivery rules (as in the case of airports, schools etc.), and provide a constantly live set of prices for particular goods and products that the customer could refer to.

Think about why you like Uber so much – it’s because everything is right there waiting for you isn’t it? There’s no worrying about a missed deal, a dodgy increase in the delivery price, or a business contacting you four hours later to tell you something you ordered is now out of stock. That’s down to the effectiveness of their Go development.

In 2016, Kai Wei, at the time an Engineering Manager for Uber before later leaving to join Google’s development team in the same role, praised Go for its high developer productivity, as well as its high performance in throughput and latency, and its excellent reliability. When it came down to it, Kai Wei could hardly have been more impressed with Go’s performance for his team.

Companies using Go

The Sound of Simplicity

Soundcloud is another major internet name that owes a lot of its success to the ease of development with Go. A self-confessed polyglot company, Soundcloud famously like their developers to be generalists when it comes to coding.

Naturally, the Soundcloud systems are built with a variety of languages alongside the main use of Ruby on Rails. So, for Soundcloud to implement and stick with a language for over 10 years, as they have done, it must be special. 

In fact, the team were so impressed by the Go language that they have since gone on to create half a dozen services written in Go, including their impressive Bazooka service, designed specifically to assist the implementation of new internal services. The underlying philosophy of “one problem – one solution” is what draws many of the internet’s top companies to look to Go to solve their problems.

The Rivals – C++ & Python

C++

At the time of Go’s creation, much of Google’s work was being completed using C++, made a name for itself as one of the more cumbersome languages to use in modern projects. While it does still have suitability for more complex applications due to the control a developer can have over performance and memory management, C++ loses out to Go by not having the simplicity of its successor, nor the ease of use or strong concurrency support.

Where Go’s support for concurrency is built-in with Goroutines and Channels, making concurrency efficient and simple, C++ requires extensive manual synchronisation using mutexes to achieve the same outcomes.

Go also benefits from automatic memory management, which avoids the heightened risk of memory leaking and undefined behaviour that can come with the manual management of C++.

Another major benefit of Go compared to C++ is the simplified syntax. There’s a pretty steep learning curve when it comes to C++, what with the various feature of its syntax, taking in object-oriented constructs and memory management options, among others. Not so for Go. The Go syntax is designed with simplicity and readability in mind and encourages cleaner code.

Python

The choice between Go and Python can depend on several factors like performance requirements, the complexity of the project, the existing expertise of your team etc. Python is well known for its extensive libraries that make it extremely versatile, but Go’s concurrency support and performance help to set it apart.

There are many similarities between Go and Python, like their syntaxes, which are both easily readable and enforce consistent, clean code. They are both also very beginner-friendly, due to the shallow learning curve that comes along with each.

However, Python’s status as an interpreted language means that performance of applications can suffer, particularly in the case of CPU-intensive tasks. This is something that Go doesn’t struggle with, as it was built with performance in mind, its concurrency model making it well-suited to handling multiple tasks simultaneously.

There are ways of achieving concurrency with Python’s multiprocessing module, but there are issues when it comes to their Global Interpreter Lock, which can limit true parallelism when it comes to multi-threaded programs.

Future Growth?

So, where next for Go? Well, the speed and efficiency of Go as a programming language, which we have discussed extensively already, means that it is ideal for building high-performing, large-scale programs and systems. Because of this, an increasing number of companies of all sizes are choosing to implement Go as their main programming language of choice.

It is clear that Go is here to stay, and it has made a real name for itself in terms of its suitability for modern software development. The increase in companies choosing to utilise Go within their development projects has led to an increase both in job availability and the number of developers who are actively learning Go to add to their development repertoire.

Its open-source nature also benefits the language, as a variety of developers constantly add to the pool of knowledge that surrounds the language, building development libraries and documentation that will be of priceless value to thousands of developers in the years to come.

Whether you are an experienced developer or a beginner just starting out in a software development career, it seems clear that there is no time to waste when it comes to learning Go, particularly if you are aiming to increase your value in an increasingly competitive technical job market.

Go back