I first attempted to learn Go in 2019. The goal was to learn about the new concurrency technique. I learnt some syntax and understood goroutines and channels. I then moved on to do other things. And I forgot most of what I had learnt.
For the previous two months I have been working on a project to develop a reusable sidecar in Go. During the process I re-learnt Go. This time I did a deep learning of the language. I also wrote a lot of code in Go. This has given me a new perspective about the language. Go is simple and yet powerful. And this is going to be the go to language for my side projects.
Things I like about Go
- Go is simple. One can learn the basics and be productive in a week. This also helps in reading existing code written in Go.
- Go is powerful and performant. Go runs natively on the machine. It has a powerful concurrency mechanism built into the language.
- Go has a rich standard library. You can code almost any server side application by using only the Go standard library. There is no need to take 100s of dependency to code a simple CRUD web server. One can also simply read code in the standard library by navigating from the IDE.
- Go has a modern tool chain. The toolchain is simple to use.
- Go has some good idioms to make code simple to write and read.
- Deploying Go apps is very easy as we just need to copy a single executable file.
- Go maintains backward compatibility. This means what you are learning now is still applicable 5 years down the line. It also means the code written now will continue to work as it is 5 years down the line.
Go is a boring technology
I have been using 2 technologies for my side project
- Python for all kinds of scripting, backend workers and data analysis scripts.
- Node.js for all apps requiring UI or web endpoint.
I used to face a lot of trouble with Node.js. The node package system is broken. There are hundreds of dependencies requiring frequent maintenance to upgrade to latest or more secure versions. I just want to write a tool and keep using it until I need to add new features. That is not possible with Node.js.
I have better experience with Python than Node.js. But the dependency management is still problematic. I used to love Python for its simplicity, but gradually I am seeing it is getting overloaded with features. Deploying Python scripts is also messy and performance is poor.
Conclusion
I will still continue to use Python for ad-hoc scripts and data analysis jobs. But I will use Go for all other things.
For my side projects, I need a language which is easy to work with and stable. It should have less or no maintenance cost. The tool should be easy to set up on any new machine. Go is fulfilling all the requirements.