Blog post

We decided to Go

Continuous learning

Keeping up with the latest trends and technologies is a must if you want to stay on top of your game. That is why we encourage everyone to continuously learn new things and share knowledge and provide support to others whenever possible. 

A while back we decided to take a look at Go. Here I’ll will mention a few key points which we

discovered were interesting during our journey.  We are nowhere close to the end of this journey, as a matter of fact, we have just begun. Hence, this is not going to go in the pearl harvesting depths of the ocean of knowledge, we will rather scratch the surface. 

If you are deciding whether to continue reading it, note that it’s not a programming tutorial. We just hope you will get some insights, and encouragement to learn Go after reading this. 

Preamble for Go.

So we said, let’s Go. Seriously, we looked at one of our existing application written in famous JavaScript which needed refactoring as soon as it was *cough* complete, and decided that we want to let it rot and manufacture a shiny new application written from scratch in the famous new Go.  Before beginning this journey, we mostly worked with high level (very) languages such as JavaScript, Java, Python and TypeScript.  

We were aware that Go is similar but also slightly different when it comes to a handful of conventions (we discuss those below).  The main reason to choose Go with Go (lol) was the main feature of Go that it claims to have, such as safety, concurrency, conciseness etc.  which we found was true.

The journey of a mile begins with a first single step.

We were not under any strict deadline or commitment so we started in a quite relaxed way. We decided to do pair programming and learning by doing.  And before we started our first session of pair programming live in Jitsi meeting, we took a few days to read the Go language documentation.  It was our first step and the most important one as well. If you are

thinking of learning Go or starting your new career as a Go programmer, we advise you to start by reading the language documentation at this link.  It is very well written and it will guide you through the process.

First Impressions

One important attribute of Go that we noticed immediately was the  conciseness of the language. It is very concise, compact, full with  interesting behaviors as a matter of fact. For example, consider the following:

func uselessGreet() (String, Error) {    return “Hello, World!”, nil}

This tiny bit of code packs in itself:

  • Conciseness,
  • Strict static type checking,
  • Defined return values,
  • And multiple return values with provision for error.

Those features are already enough motivation for trying out a new language. But as we started converting our beloved JavaScript code into Go, we started discovering countless gems spread across this wonderful language ecosystem.

In a quick glance it may even seem that it isn’t much different from JavaScript or any other conventional procedural languages as it also contains variables, functions, conditionals such as if, else, for, switch blocks etc..But there lies something special: Go inherits best practices and patterns from a lot of  programming heritage and manifests them into a concise and fun language with a few idiosyncratic inventions of its own. 

A few of other goodies go offers are:

  • Goroutines (look it up, it’s awesome),
  • Type inference,
  • Formatting and linting with additional tools,
  • Small binaries,
  • Really good packaging system etc.

And not to mention, maybe important of all, a really enthusiastic developer community and thriving, ever growing, ecosystem.

The worst and the best ideas

I must admit now that converting our beloved JavaScript code into Go was the worst idea ever. You ask why? Because Go is different with very different conventions than JavaScript. So we started re-designing the application in Go way. And that was the best idea.

This read is long, should I Go now?

Information Technology is changing very fast, we must keep up with the trends. But, do not get me wrong, I know it may not always be required for job security to keep up but to expand our horizon, to get a different perspective and to understand the world a little more, we should keep learning. 

Not to mention, if you already want to learn a new programming language, learn Go. If you are starting out, learn Go. 

Yes, you can Go now.