Showing posts with label go. Show all posts
Showing posts with label go. Show all posts

Friday, November 18, 2016

Mastering Go

Earlier this year I blogged briefly about learning Go. Having gotten very comfortable with the language, I've written a bunch of small programs and we've deployed some fairly critical code to production at work, and I'm looking at rewriting another production system in Go, so I'm on the path to mastery now.

Having implemented the same concurrency patterns in both Perl and Go, I'm very happy with the power that Go's channels and goroutines provide; it makes concurrent systems much quicker to get up and running and I spend very little time testing and worrying about read/write buffers and blocking/nonblocking calls.

The next step will be getting into the wide world of third-party libraries that other people have written to look for defacto standard modules (like what DBI is to Perl).

All in all, a fun ride so far.

Thursday, March 24, 2016

Go

In the very small amount of spare time that I have at the moment, I'm learning to program in Go, with a short-term goal to write some performance testing utilities for work and a long-term goal to make it my second go-to language after Perl.

The reasons I've chosen Go are pretty simple:

  1. Healthy ecosystem. There are tons of libraries, lots of articles, plenty of discussion and frequent updates to the compiler.
  2. Simple concurrency primitives. A lot of the problems I'm dealing with at the moment need to be approached with concurrency in mind. Goroutines and channels fit a lot of these problems really well.
  3. Statically linked executables. This is really nice to have. It means when I write performance testing utilities for work, they are easily deployed and run on all kinds of machines, whether they're for one product or another or whether it's a production or development environment. It means I can avoid any runtime dependency hell if there are subtle environment differences between machines and it means I don't have to change the state of the machine just to run my code.
  4. Composition over inheritance. It's a personal preference, but I hate inheritance once it grows beyond a couple of layers.

Now, just wait a few months and I'll write a blog post titled "what I hate about Go" :)