Blake Mizerany - Early Go mistakes, dependency usage

Authored by sqs1

Blake Mizerany (@bmizerany) is the creator of Sinatra and the co-creator of Doozer. He currently works at CoreOS and previously worked at Heroku.

image

photo credit: Nicolas Ravelli

Blake opened up with an allegory about people who jump into things too quickly. Along these lines, he brought up several common Go fallacies that he first succumbed to but has since learned the better of.

Fallacy 1: Go is doing it wrong.

In reality, Go is doing things Go’s way.

When Blake started out with Go, he was most familiar with Ruby, and he wrote bmizerany/assert, which was essentially trying to write Go as you would Ruby. He initially tried to make Go do things in Ruby’s way. Lesson learned. He now just uses an if-statement and t.Errorf.

Fallacy 2: Predetermination. You know exactly what you need.

E.g., “net/http is lacking. We need more.” So you pull in a huge external dependency.

To Blake, immediately deciding to use an external library is folly.

Consider gorilla/mux. Most of the features of gorilla/mux just save you from having to type a few if-statements at the cost of much greater complexity.

Fallacy 3: If it’s on GitHub, it’s ready for production.

Enough said. “You wouldn’t go around picking stuff off the street and eating it. Why do so with your dependencies?”

Conclusion

Most Go programs don’t require external dependencies.

Q&A

Q: How did Go get introduced to Heroku? A: Keith Rarick and Blake decided to use Go for a Paxos implementation on a whim. Never looked back.

Want to hear more from Blake? Follow him @bmizerany, check out his GitHub projects, and see his open-source contributions on Sourcegraph.