Sorry, Ruby — I think I’ve fallen for Go!

It was just about ten years ago that the initial commit of the iconic Ruby on Rails app framework was published. It almost immediately began sending developers like me into somewhat of a frenzy.

I began to digest and understand Ruby (and Rails) and realized — hey! — this was the first time any language just made sense right out of the box. The code read like a developer’s love poem. Concepts previously foreign to me such as “model-view-controller” seemed to suddenly click. No longer was I struggling to understand syntax as I did with PHP or Perl. I was able to splice together a rough (but working!) prototype of a web app in as little as a few days.

There was no mistaking it…
I Ruby!

As I began to venture into managing backend systems and architecture, command-line tools and scripts were frequently needed to be created. Ruby was okay for building tooling, but again — too slow. Statically-compiled languages (like C and Java) never made much sense to me. Attempts to build something simple would result in me throwing my hands in the air, shouting, “This is just too complex!” — especially after being spoiled rotten with Ruby, my first true love!

Things changed while I was working at Rovi back in 2013 when Go was recommended to me in passing for a certain tool I was trying to build. I figured I would give it a try. For the first time since Ruby had won my heart, I felt a spark! I wrote my first tool in a compiled language and put it into production that day. I couldn’t contain my excitement, and desperately sought out more reasons to use Go.

  • ht-load-test — enables engineers to quickly and easily run performance benchmarks on any API endpoint. Prior attempts to build such a tool using JRuby had required many external dependencies to be downloaded, installed and configured(Apache JMeter, some Ruby gems, etc), whereas now one must simply download a single binary from GitHub, or alternatively, simply run it from a Docker container.
  • ht-db-clone — creates a new Amazon RDS database instance from the most recent production database snapshot. Once it becomes available, it runs required Rake tasks to clean/generate data. Finally, it optionally updates a given Amazon Route 53 SRV resource record set for the updated database instance hostname.

For me, Go has proven itself to be my go-to language when building tooling like this because it is easy to pick up and run with. The HT engineering team were all pretty impressed by the rapid development turnaround time.

I think it is time to face the truth…
I Go!

For now, though, here are some things I’ve found or learned that may help new developers:

  • Go expects developers to stick to community conventions. Adhering to the naming guidelines will ensure new developers will have a solid grounding when they are onboarded to an existing project.
  • Reading the tests of an external package on GitHub can help you understand fastest. For example: look at how to make a POST request with the standard Go net/http client package.
  • The Go community is fresh, and grows every day. There are excellent community-generated resources such as the curated awesome-go list (similar to Ruby Toolbox), as well as official help channels via IRC, the mailing list, and more. Get the latest news about Go at Reddit via /r/golang, or Twitter via @golang. Read books about Go, find a sweet new job to show off all your new skills… I could go on.

Are you an experienced Go developer?
Have a pro tip to share with others? Add it to the responses below! Thanks!

Ruby + Go = ❤

Discuss on HN or Reddit

Ten-year Ruby on Rails vet, devops extraordinaire, & Golang guru-in-training

Ten-year Ruby on Rails vet, devops extraordinaire, & Golang guru-in-training