Go, and When It's Okay to Learn New Things
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.
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.