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?
Steve: I am the creator of the popular static website engine Hugo, as well as many libraries including Cobra, Nitro and Viper. I am also the creator of the popular community vim distribution spf13-vim. I am the author of multiple O’Reilly books, and blog at spf13.com and am an in demand speaker delivering inspiring talks and workshops around the world. I am the the Chief Developer Advocate at MongoDB in New York City responsible for the developer experience of MongoDB and lead the software engineering team responsible for drivers and integrations with all languages, libraries and frameworks. I love open source and am thrilled to be able to work on it full time. When not coding I enjoy skateboarding and having fun outdoors with my wife and four children.
Qs. Why and when did you decide to start working with Go?
Steve: I had been poking around with it for a while, but it wasn’t until I finally had a project that I could dive into it. I got fed up with one too many security updates to Wordpress on my blog and decided I would write my own website engine in Go. That was a couple of years ago.
Qs. How should one go about learning the Go language? What material (books, eBooks, online tutorials etc.) would you recommend?
Steve: I think there’s a lot of great material available, especially considering how young the language is. I found the Go tour extremely helpful. I also learned a lot by reading through the source of the standard library, which not only shows you how to write Go, but the idioms as well. Lastly, I think there are a lot of great talks and tutorials given by the Go team and by the community. I gave a beginners workshop on building your first Go application at OSCON that would be a great resource for anyone learning Go. You can find it at http://spf13.com/presentation/first-go-app.
Qs. What best practices are most important for a new Go programmer to learn and understand?
Steve: The one thing that I feel is the most important thing to know about Go is that it’s not complicated. I think coming from other languages we are often trained to think of things in complicated ways. Every time I became confused about something I was always over thinking it, trying to do a more complicated solution than needed. You see this all throughout Go.
Qs. What are the pros and cons of Go that are being discussed in the development community and what is your opinion on that?
Steve: The pros I hear most about Go are the speed and ease of use. Go is easy to be productive in, compiles super fast and executes quickly.
The most common con I hear about Go is that it’s missing generics. I hear this most from people who haven’t actually tried Go… dismissing the entire language because it seems to be missing their magic feature. Go is simple by design. Simplicity is a core goal of the language. One of the features I like most about Go is the features it doesn’t have. Now as for generics, I do think it would be a nice addition to the language, but not a very important one. It’s also not clear how it would work with the wonderful interface design already in Go. There’s a few packages I’ve written where I thought, “if Go had generics I could have written this in a quarter the time”, but such occasions have been rare. I have always been able to write the code I wanted to, it just took me more lines to do it. Consequently, I don’t think it’s an essential feature and the discussion around it far outweighs the benefit it would provide.
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?
Steve: I’m so glad you asked. Hugo is a website creation system I started writing a couple years ago. It has the second largest contributor base of any Go app or library I’m aware of (Docker has the most). We are approaching nearly 100 different contributors. This is quite an accomplishment for such a young project. For a significant majority of contributors it was their first contribution to a Go project. On behalf of the entire Hugo team we would love more contributors. We would be happy to mentor anyone who would like to gain experience and contribute.
Qs. What has been your biggest challenge while working with Go?
Steve: I would have a hard time picking just one, so I’ll share two related challenges. The two challenges are a lack of libraries and lack of documentation. Both are typical conditions of a young language. In spite of a surprisingly extensive standard library for it’s age, writing applications in Go today often means writing your own libraries. It also often means reading the source to understand how to use third party packages. When I was writing Hugo, I ended up developing a handful of other libraries as I went because I needed a library that didn’t exist yet. For example, I needed a good command line commander. Unable to find one, I wrote Cobra which is now being used by open shift and a bunch of other applications. Also while writing Hugo, I needed a good library to handle configuration so I wrote Viper to fill that void. I want to note that both have good documentation.
These challenges are a bit of a double edged sword. While you may need to write a few more libraries than you would need to in a more established community like java or ruby, you get the benefit of being able to help create the libraries that the community will use. I don’t think there’s ever an excuse for not writing documentation though. If you are going to spend the time to writing a library and share it under an open source license then you should provide documentation on how to use it.
Qs. What types of applications are currently being developed in Go and what changes do you foresee over the next year or two?
Steve: I think we are still in the early adoption period of Go. I see two different areas of large activity in Go today. The first one is on the systems side. You see this with tools like Docker, Packer, CoreOS and the like. The second area is writing websites and APIs. Go’s speed and efficiency here is unparalleled and I’m seeing a lot of companies switch to it as a result.
Qs. How do you see the market for Go Programmers in the work place? What is the future for Go?
Steve: I think it’s still quite early. Go is starting to gain adoption at the developer level, but not so much today at the CTO level. Consequently the number of companies hiring Go programmers today is still small and your options are going to be far more limited than they would be compared to Java or Python.
I think the future is bright for Go. CTOs are generally quite risk adverse and money conscious. Go is easy to learn and cost effective both from a development point of view and from an operational point of view. Companies that adopt Go coming from dynamic languages report needing significantly fewer servers and far simpler deployments. I think it will just take a bit of time for the word to spread, developers to be trained, and packages to be written for decision makers to recognize that adopting Go is a safe and prudent solution.
Qs. Do you have any other suggestions for our readers?
Steve: I really think the best way to learn a new language is to jump in with both feet. Find a project that you can work on, either start your own or join an existing one. Don’t be shy about asking questions on the mailing list or in the slack room. Everyone is still learning and the community is the friendliest I’ve ever seen.
Thanks Steve 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 Steve would be glad to answer.
Tweet