Qs. Welcome and thanks for taking out time to share your thoughts. For the benefit of the readers, could you tell us something about your-self?
Nate: I am a developer at Canonical, working on Juju. I have worked at Canonical for over a year, previously I did C# work at a company that creates software for financial services companies, and before that I worked at several startups.
Qs. Why and when did you decide to start working with Go?
Nate: It’s been nearly two years since I started using Go. The first time I heard about it, I actually dismissed it after seeing that it didn’t have exceptions. I believe that was around the release of 1.0. At the release of 1.1 I looked at it again, and decided to give it a try, and fell in love with the simple syntax. Last year I jumped at the chance to work in Go full time at Canonical.
Qs. How should one go about learning the Go language? What material (books, eBooks, online tutorials etc.) would you recommend?
Nate: First and foremost, go through the Go Tour. It doesn’t take that long, but it does a really great job at introducing the basics and getting you writing real code. Then, pick up a book. There are, unfortunately, not a ton of great Go books around. The one on my desk is Programming in Go by Mark Summerfield, though it looks like Go in Action is coming along nicely. I find that it can be helpful to just read through the first few chapters of a programming book to immerse yourself in a language. Online tutorials don’t always suffice.
Next, visit reddit’s r/golang and of course, go-nuts on google groups. Read everything. You’ll learn a ton just by reading everyone else’s questions and the answers they’re given.
One thing that was very helpful for me was to port an existing project from another language to Go. This gives you a clear spec on how the project should function, the project has proven its utility in that other language, and it means you can concentrate on the code, and not on how things should work.
Qs. What best practices are most important for a new Go programmer to learn and understand?
Nate: Write Go like Go. Don’t try to write it like some other language. It’s not Java, it’s not Python, it’s not Ruby. It’s Go. That means use small interfaces. Return an error if something can fail. Make your code simple, not clever. Be merciless in your push for simplicity.
Qs. What are the pros and cons of Go that are being discussed in the development community and what is your opinion on that?
Nate: The pro often given is “good concurrency”, which is true, but isn’t what makes the language awesome. It’s the simplicity that makes Go awesome. How easy it is to write code that is just obvious about what it does. Go’s obvious and simple concurrency feeds into that, but it’s just one part of the whole.
One of the common cons of Go is the lack of exceptions. I actually count this as a pro. Writing good exception handling code is really hard, and is invisible in most code. Go’s error handling code may be more verbose, but it’s also explicit and visible and obvious.
Qs. Most beginners in Go would like to contribute their time, skills and expertise to a project but invariably are unaware of where and how to do so. Could you suggest some?
Nate: Hugo is a great place to cut your teeth on Go, because the project is a manageable size, and it doesn’t take much to get in there and fix a bug or two. There are a lot of other projects which are also worthy, but require a lot more ramp-up and Go knowledge.
Qs. What has been your biggest challenge while working with Go?
Nate: Juju is a cross-platform product, and it can be really difficult to get code that works correctly on all platforms. With differences between the OSes, you often need subtly different behavior on each of them, which can make maintenance a headache.
Qs. What types of applications are currently being developed in Go and what changes do you foresee over the next year or two?
Nate: Right now the big ones are all servers - sure, some web servers, but also more complicated servers, like Juju and etcd and Google’s kubernetes. Small projects are often command line applications - another place where Go excels.
Go is going to take over server development, and quite possibly take over web backend code…. Go is so much faster than python or ruby and uses so much less memory than Java, it’s really the natural choice for both enterprises and startups.
Qs. How do you see the market for Go Programmers in the work place? What is the future for Go?
Nate: The market for Go programmers is good, but still pretty small. There’s definitely demand, but you’ll need to prove your worth as a general programmer, because most people hiring programmers for Go projects realize that they don’t really need Go experts. Anyone can learn Go, which means companies can hire a python or java developer and just teach them Go in a week.
Qs. Do you have any other suggestions for our readers?
Nate: Find a hole in the Go ecology and fill it so all gophers can benefit from your work.
Thanks Nate for sharing your views with us. I am confident that your insights would help all the would-be Go programmers. In case you have any queries and/or questions, kindly post your questions here (as comments to this blog post) and Nate would be glad to answer.
Tweet