Going, Going, Golang: A First Pass At Learning Golang

Geomys bursarius, or the plains pocket gopher. Alternatively, Me, in my natural habitat, expressing concern about learning a new compiled language.

Personal story time! I started studying web development at Flatiron exactly two years ago. Though I’d done work with other languages before, the entirety of that course was in Ruby and JavaScript. Two languages, I’m sure you’re aware, not exactly known for static typing or needing compilation. I have, for most of the past two years, looked longing at the wild west of JS development, always afraid to jump back into learning, you know, low-level crunchy languages. Imagine my surprise when I decided a few weeks ago to start teaching myself Go.

One of the through lines for the past two years has been my increasing interest in DevOps. I’ve been tinkering with Docker recently, and I eventually stumbled onto the fact that it was written in Go. Having nothing better to do, I decided to try my luck and see if I could understand this strange new language. It was only after I started the Go Tutorial that I even realized what I was stumbling into. I’m not exactly what you’d call an expert in compiled languages. Professionally, of course, I’ve worked with Java for most of my career— but even so, I still feel more comfortable with interpreted languages.

That being said, a fair bit of the tutorial came and went without much fanfare. Programming is programming, after all. But! Then I found my way to the section on Pointers. I’d studied C++ a little, way back when, so I’m not unfamiliar with pointers. Still, it’s an abstraction I’ve struggled to wrap my head around in practice. The concept’s fine: instead of saving data to a variable, I’m saving a location to reference that value into a variable. Instead of carting around multiple bytes of data in a string everywhere I want to use it, I’ve instead got a neat and small package that points me to where I can find my much clunkier data. It’s just something I’m still getting used to.

Imagine how I felt when encountering slices. Again, due to my background in C++, I know about the concept of static vs. dynamic arrays. But slices still felt alien to me. Are they a subset of a static array? A pointer to a complete array? Or something else entirely, a totally dynamic array? Near as I can tell, it’s all three. I’m not used to one language feature having three such wildly different uses. I’m a rubyist, I’m used to having three wildly different language features having the exact same use!

Still, with enough elbow grease, I managed to work my way through the exercises, to the point where I’m sitting at the Maps Exercise, bonking my head against a wall in hopes of finally understanding it. As I learn more about Go, I plan on keeping a running tally of my thoughts, so feel free to check back again later, see if I’ve gotten anywhere!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store