My use-case for Go
Tags: go, programminglanguages
Published: 2017-08-27 16:33:21

---
title: My use-case for Go
published: true
description: After using a few very good applications written in Go (Syncthing, Docker and Hugo are some examples) I wanted to get to learn a bit more about the language.
tags: ["Go", "Programming Languages"]
---
After using a few very good applications written in Go ([Syncthing](https://syncthing.net/), [Docker](https://www.docker.com) and [Hugo](https://gohugo.io/) are some examples) I wanted to get to learn a bit more about the language.

I'm very interested in programming languages theory and how it could give developers the tools they need to write software in the best possible way and with as many guarantees as possible on the correctness of the resulting applications.

To get an idea of where programming languages theory is headed have a look at [the post](http://graydon2.dreamwidth.org/253769.html) [Graydon Hoare](http://twitter.com/graydon_pub) (the creator of Rust and now one of Swift's developers) published  discussing possible new research directions for programming languages.

I obviously wasn't expecting Go to address any of these issues but I find it very interesting that its designers deliberately ignored lots of what I would consider [basics features](http://yager.io/programming/go.html) in the name of simplicity.
The [lack of generics](https://medium.com/@sameer_74231/go-experience-report-for-generics-google-metrics-api-b019d597aaa4) is often mentioned in discussions regarding Go.
I would have liked Go to have algebraic data types and immutability by default. I would gladly give [*nil*](https://www.infoq.com/presentations/Null-References-The-Billion-Dollar-Mistake-Tony-Hoare) away to get these features.

On the positive side, Go has good libraries, good tooling, a common style and a syntax that is extremely easy to pick up. It's fast enough and it has good support for concurrency via [goroutines](https://tour.golang.org/concurrency/1). It also produces executables that are very easy to deploy anywhere.

Given this description, it seems to me that Go is an evolution of C and Python and I decided to give it a try  [rewriting a project](https://github.com/mariosangiorgio/dunbar-go) originally written in Python I am working on.

That project is very simple, small and self contained. It interacts with Twitter (a good library is a huge plus), and it analyzes my interactions with the people I follow.
The goal is to find out if I'm following people I am not interacting with much.
I somehow ended up following too many people and I needed to find a way to bring my following to a more manageable number.

That is admittedly something too simple to draw conclusions, but I think it was still good  enough to get a feeling of the language and I had a good impression.
Picking up the language has been very easy, the library I used is good. With respect to Python I have a type system, albeit limited, and I get an executable I can easily deploy with no additional dependencies.

Given this experience I believe I'll consider Go again for projects of a similar size and scope or for simple command line applications.
For that use case, I believe it's a much better fit than Python while it's simplicity could make me be more productive than if I were  using other languages.

Originally posted on [mariosangiorgio.github.io](https://mariosangiorgio.github.io/post/my-use-case-for-go/)