It was Todd Mcleod that said something like this… "The more I learn the harder it gets to ask questions, the more I ask questions the more I learn"

If you're looking for a scalable, light on the page open source programming language, there are a few great options out there. But one that often goes comparatively unnoticed is Go, first released in 2012. Here, I'll explore some of the attributes and benefits of the language and provide a few resources to learn more.

Before I actually start to talk about Go, I want to talk about its credentials, and specifically, its creators' credentials.

Go was created by three guys called Rob Pike, Robert Griesemer and Ken Thompson. Let's take a look at what these guys had already accomplished before creating Go:

Rob Pike, who for me is like the Yoda of the computer programming world today (I'm a big fan), is best known for his work at Bell Labs, where he was a member of the Unix team and was involved in the creation of the Plan 9 from Bell Labs and Inferno operating systems, as well as the Limbo programming language. Oh! And he also helped create a little something called UTF-8, which you may have heard of!

Robert Griesemer had an early interest in programming languages and ended up studying in Switzerland under the creator of Pascal, a language which many people say had a direct influence on Go. He also had about 15 years of experience working with C++, but his biggest qualification, in my opinion, is that he was recruited by Rob and Ken to join the original Go Team at Google.

Ken Thompson, this guy is out of this world. If Yoda had a brother, it would be Ken. He spent most of his career at Bell Labs, and he was solely responsible for designing and implementing the original Unix operating system. He also invented the B programming language, the direct predecessor to the C programming language, and was one of the creators and early developers of the Plan 9 operating systems. You read that right - he invented the programming language that came before C.

Anyway, this trio worked at Google when Go was originally created.

golang-1.png

Perfomance:

One thing that I like to point it out is that Go is one of a few languages created after computers had more then one core. And Go makes exceptional use of that!

Go is a typed language that is compiled to machine code. And unlike other new languages that have relied on LLVM, such as Swift and Rust, Go is built from the ground up. It is not dependent on layers like virtual machines, etc. to run. Additionally, Go has “goroutines”, that are much more efficient and cheaper to create than threads.

Simplicity:

"Go was born out of frustration with existing languages and environments for systems programming. Programming had become too difficult and the choice of languages was partly to blame. One had to choose either efficient compilation, efficient execution, or ease of programming; all three were not available in the same mainstream language." https://golang.org/doc/faq

Simplicity was a key motivation and a requirement for the design from the beginning. If you are serious about the language, you should definitely read this paper by Rob Pike. In Go, compile times are fast - making the immediacy of running a program feel like a scripting language, which is another win for Go when it comes to performance. Another great feature is that it does not suffer from continuous language changes. In fact, a crucial premise in Go is to have no change in the language. If you come from mobile development, for example, and worked with Swift, you know what it is like to have a language that continuously changes. The Go Standard library is very good. For example, the net/http library is used directly to write servers and there is no need to use layer upon layer of frameworks to write, such as in Ruby or Javascript.

Concurrency:

"Concurrency is not parallelism.", Go Proverbs

Concurrency is a huge part of Go! Go has built-in support for concurrency with Goroutines and Channels, making it a natural choice for writing back-end systems with messaging, caching and scalability requirements. This is particularly attractive to programmers coming from single threaded languages like Ruby, Python and others. It's not that those languages do not support multithreaded applications, but they need some type of implementation to actually support it.

Rob Pike has an extremely elucidating talk on concurrency that you can watch called Concurrency is no Parallelism.

Deployment:

Go compiles everything into a statically linked binary file, so no dependencies are required and you're left with only a single binary to deploy. This simplifies deployment significantly. You don’t have to worry about whether your users have Ruby, or for that matter, the JVM installed. Nor do you need to worry about a dependency being upgraded since the entire program is compiled into a single binary. Sweet, right?!

Who else is using it?

Well, besides Google?

Here are some: Docker, Heroku, Netflix, Uber, Hashicorp, New Relic, New York Times… just to name a few.

There is a long list of companies using Go nowadays, and it's only growing. Here is a official list of companies using it around the world. Note that this list is not exhaustive - I personally came name a few companies using Go that do not appear on this list.

Where do I start?

One really good place to begin is the Go Tour. It does a great job teaching the basics and helps you develop some fluency, since you learn by playing around in the Go Playground. The playground is like an online code editor, where you can run small chunks of code, save, and share with unique links. For reference we have the Effective Go guide. And of course there is the Go Language specification, but until you're familiar with the basics, you may find it to be a bit dense at first.

Those are all good places to start, but if you/re ready to go the distance and invest, I recommend the Code School course on Go Language, which is great to get you started. There is also a course on Udemy by Todd Mcleod called Learn How To Code: Google’s Go (golang) Programming Language which I think does a nice job. I can also recommend about of books:

Conclusion:

Fans of Go (called Gophers, by the way) describe Go as having the expressiveness of dynamic languages like Python or Ruby, with the performance of compiled languages like C or C++.

In conclusion, Go is a performatic and simple language, with concurrency naturally built in, deployment as easy as can be, created by some of the best minds in computer programming today. It's also supported by Google and huge community of open source developers with huge momentum, and has been growing faster and faster every day.

So really, the question you should be asking yourself isn't "Why learn go", but rather, "Why aren't we already using it?".


Author

João Henrique Machado Silva

João Silva is a self-taught developer with 15+ years of experience. He loves programming languages, talking to people, Crossfit, coffee and cooking, and not exactly in that order.


Asymmetric Cryptography

READ MORE

Improving the developer experience when documenting

READ MORE

How to Run Rust from Python

READ MORE

How to Create a Tic-Tac-Toe Board Using React.js

READ MORE