Why Go?

Rafael Escrich
3 min readFeb 6, 2019
Gopher (language mascot)

This is my first story in Medium and I decided to write about this language that I really like. Sometime ago at the company that I work, we had a new challenge. This new project had some particularities and we decided to choose Go. Looking back now I can assure you that was one of the best career decisions that I took and I will explain my reasons below.

History of Go

Go is a modern generic purpose open source programming language that was officially announced at the end of 2009. It began in 2007 as an internal Google project and has been inspired by many other programming languages including C, Pascal, Alef, and Oberon. Among the creators of the language are Ken Thomson and Rob Pike, who designed Go as a language for professional programmers who want to build reliable and robust software.[1]

Initial Goals

The main objectives were design a system’s programming language with a familiar syntax and features to address some big problems that developers were facing inside Google. Some of these problems, that are common to other big companies are slow builds, stacks with more than one language, multi-core processors, networked systems, massive computation clusters with difficulty managing dependencies. To address this problems they begin to design a new language first called Golang.

My reasons

When I first started learning Go one of my first impressions was that it was strange. I was used to Javascript and Object Oriented Pattern, so the procedural way and more then one return to a method was awkward to me. The learning curve to Python and Javascript programmers is small. When I’m writing code I try to give meaningful name to variables and functions so I found weird the Go way of variables names with just three letters or less. It’s like a Go way to write code but not required. One thing it is required is that you don’t use underscore.

A few months later the language really got me and now is the only language I use. I will list some really good features below.

It has a very powerful standard library. When I say very powerful is because it is indeed very powerful and modern. It has modern cryptography and network features built-in for example.

You can produce the binaries to your application with all libraries it needs to run. No more list of software to install before run you application. Also, you can cross-compile to a lot of different architectures and operational systems. That’s really nice because cross-compiled a binary in my laptop and use it in my Raspberry Pi. Here is the list:

Go is fast. Comparing with other languages it’s faster. And you can put C code inside it.

https://medium.com/@learnitnow/ruby-vs-elixir-vs-go-a-concurrency-comparision-d2330c1fa3a6

It has native concurrency support. The language designers wanted that Go had a easy way to add concurrency to a piece of code so they created Goroutines. A goroutine is a function that is capable of running concurrently with other functions. To create a goroutine we use the keyword go followed by a function invocation. It’s that simple.

It’s easy to write tests. Unit tests don’t need external tools to run. So to create them, you just need to write other file with the same filename of the file you want to test and end it with _test.go and write your tests there. For example: file.go and file_test.go, when you run go test your code is tested.

Another great thing about Go is that there is a big and active online and offline community with various meetups all around the world. And a lot of open-source libraries in the github to use. :)

That’s it. I hope you liked the text and give Go a try! I will write some links that helped me below.

Links

https://golang.org/

https://gobyexample.com/

https://github.com/avelino/awesome-go

References

[1] https://talks.golang.org/2012/splash.article

--

--

Rafael Escrich

Cypherpunk, blockchain developer and crypto entrepreneur. Likes to cook, read and spend quality time with wife and daughter.