Go, and When It's Okay to Learn New Things
12.1.2018
I’ve been meaning to make a post about my foray into Go for some time now. I’ve been learning it on the side (although a little bit at work too) for maybe the past 8 months now, and have really enjoyed it.
I sort of resisted learning another language (after Ruby and JavaScript) for a while because I felt I still had so much to learn in both of those, and that I’d be better off devoting my time to improvement there. I had seen others who were seemingly learning a new language or framework every month, and I couldn’t fathom how anyone could get much beyond a "tutorial level knowledge" that way. But I get it - learning a new language or technology is fun and exciting, sort of like starting a new project instead of putting (more difficult) labor into one that is slowly sinking into your GitHub graveyard. And certainly having a breadth of knowledge is important.
Side note, I can’t visit Hacker News too much (even though I like it), because the temptation to learn about all of the things referenced in the top posts (which everyone there seems to know like the back of their hands) is too great.
Eventually though, I decided it was time to add something to my tool belt. I use Ruby and JS everyday at work, so my knowledge of those certainly isn’t going to get worse. I will continue growing in those for the foreseeable future.
I tried C first. Perhaps it was the tutorial I went through, but it just didn’t click for me. Perhaps being so comfortable with Ruby and its decidedly non-C ways made it too much for me. I would still like to learn it, but I needed something that needed a bit less hand holding.
Enter Go. To be honest, it’s definitely trendy right now. Posts about cool projects in Golang make it to the top of the aforementioned Hacker News seemingly every day (not that I, uh, check). But you know what? Picking a new language because it’s trendy is fine. Sometimes a thing is popular because (get this) a lot of people like it.
Go is different from Ruby in interesting ways. It is strongly typed. It is compiled. It does concurrency well (I’m sorry). But it is similar in important ways - it is extremely readable, and object oriented. And like Ruby, it is very nice fit for web development.
So what did I do to learn it? I started with the Tour of Go. This was a bit difficult for me (even though it’s meant not to be…), but more approachable than C. I also used other resources on the Go site, such as their web applications demo, which was nice because it showed how a working, "real" program could come together.
I then dove into the excellent book, The Go Programming Language by Donovan and Kernighan. This thing is thick, full of tons of examples, and deep info about the language. It took me a long, long time to get through it.
While working through the book, I started to build things. Small things that I felt I could handle, and then eventually bigger things. All the while leveraging the book, the Go docs, Go By Example, and of course, Stack Overflow. I pretty much always have some sort of Go project in progress now.
One particularly helpful learning experience was when I prepared a talk about Go for my coworkers. I basically gave an overview of the parts of the language I understood, and walked them through building a small sample app. This turned into a great learning experience for me. You study something much more deeply when you know you’re going to need to explain it clearly to others.
I finally finished The Go Programming Language and have moved on to Go in Practice, which gives less of an overview of the language, and more examples of its usage out in the wild. One thing that piqued my interest (though I haven’t gotten into yet) was the section on microservices and gRPC.
I have often heard that knowing one language can make it easier to learn another. I wasn’t sure how true that was, until now. But I have a caveat - your knowledge of the previous language needs to be at a certain point. Not expert level knowledge (which I don’t believe I have), but to be at a point where you’ve solved enough problems and built enough stuff to recognize, "Oh, I need the program to do X - I wonder how you do that in Go?" I guess you could say that you need to know which questions to ask.
One final thought. What does it mean to say you know something? Epistemological concerns aside, when do you tell people "Oh yeah, I know Go"? I think this was part of my concern before - if I didn’t really KNOW Ruby or JavaScript, how could I justify learning something else? I think the answer is that (duh) knowledge is a spectrum. And there will always be more to learn, whether you're in your first or fiftieth year of something. And that shouldn’t be cause for trepidation, that should be exciting!
Other Posts
The Best Projects Can Be Done in a Weekend
Everyone Has Something To Offer
Book Thoughts: Capital and Ideology
Naive Diffie-Hellman Implementation in Ruby
When Does the Magic Comment Work, and When Does it Not?
Benchmarking Arrays Full of Nils
Grouping Records by Month with Ruby
Add Timestamps to Existing Tables in Rails
The Busy and (Somewhat) Fit Developer
TuxedoCSS and the Rails Asset Pipeline
Gem You Should Know About: auto_html
Querying for Today's Date with ActiveRecord