It was that time again to try and learn a new language and like always I tried to figure out which of all the hippest languages was the one to get some of my precious time. Having jumped on the bandwagon too early on other languages, I've learned my lesson to learn the current most popular one. So what was my threshold this time?
- How long has it been around?
- Does it have an active community?
- Are people using it in production?
- Maturity of its toolchain
- How hard is it for me to deploy?
There were some contenders but I decided to go a non-JVM route so ended up with Golang...back to my college roots of C-like compiled binaries. Although I had some flashbacks of long nights at Qualcomm wading through Makefile after Makefile trying to figure out where the wrong compile flag came from but I decided to try it out anyways.
Learning the syntax was probably the easiest part of this journey. Despite differences from other languages, I found myself enjoying its conciseness and some of its fundamental choices like ability to return multiple objects and the disappearance of unnecessary characters. Once I got past the tutorials I tried building my own project - Animagi - an object mapper of sorts.
Most important to me was the kind of testing support available. It's nice that core language comes with a pretty good testing package but luckily I came accross Gomega and Ginkgo. With these two I was able to create some nice looking BDD tests with easy to use expectations. Brought me back to my rspec days with Ruby.
Now that I know I can test my code I started looking at the dependency management - having heard for the past few years that was one of the sticky points - I was happy to see that 'go dep' had made pretty nice progress. I've been spoiled with Maven, Gradle and to a lesser degree NPM/shrinkwrap. Although it still needs a lot of work its usable.
Lastly deployments.
Although Animagi is a library, I wrote the smallest webserver possible that does absolutley nothing and compiled it.
Docker to the rescue.
I really didn't want to worry about differences between the build server, and the test server, and the production server simply because one box got some package updates and others didn't so why not just throw the binary in a docker image through it in a container somewhere.
It's still early to put my verdict in writing but so far it's been fun and promising. Once I finish Animagi I'll start writing a full web service with routes for APIs and exported metrics that can be monitored. I feel like it'll be somewhere in between Spring Boot and an express node app.
Note:
The gopher image is licensed under Creative Commons Attributions 3.0. Credit: Renee French