Play with Go
Play with Go is a set of hands-on, interactive tutorials for learning the tools used while programming in Go. In this episode we are joined by its creators, Paul Jolly and Marcos Nils, as we learn more about what motivated the creation of the project, what technology it was built on, and how you can help contribute additional guides to help your fellow gophers!
Matched from the episode's transcript 👇
Paul Jolly: Yeah, sure. So the simplest way to describe it is to think of – the Tour of Go is very familiar to people as a way of starting to learn the Go programming language… But once you want to go beyond the language and actually wrap your hands around something and create something, you need to understand the Go tooling. And that’s where you need to get something set up locally, generally speaking. You need to install Go, have your computer set up with an editor etc.
So Play with Go is a very low-cost way, that doesn’t require you to have anything installed locally. As I said, the guides are browser-based. So when you open a Play with Go guide, on the left-hand side you’ve got the guide, which reads as a guide, or a tutorial as usual. On the right-hand side of the page is an actual interactive terminal that is hosted on Google Cloud. So this is effectively real compute resources that are live in the browser for you. So as you’re working your way through the guide, you’ve got command blocks in this left-hand side, which is the tutorial part, and you can actually click on those command blocks and they will execute in the right-hand side, the terminal, on that, in the Google Cloud compute resources.
For example, you could have a command block at the left-hand side that simply just ran go version and that would run the command on the right-hand side and show you the output from it. So that’s the interactive nature of it.
You can also create files as you’re going along. For example, let’s just imagine you’re creating a guide that explains how to create tests in Go. You would obviously create yourself a package, and then within that package you would have perhaps a regular package file and then a test file, as well… And you would create these two files by having code blocks in the left-hand side of the guide, and then with the final command block you would click on the command block and that would run go test, and you’d see all this happening live within your browser.
So this is a bit of an experiment really to see whether this kind of interactive type of documentation works… Because the Tour of Go and Go Playground are incredibly popular as a way of getting to know the language, but then at that point there’s kind of nothing; you’re left to your own devices. And this is a way that, as Carmen said in her closing keynote at GopherCon, of trying to lower the barriers to entry, if you like, for the next one million Gophers, i.e. not place any requirements on them to have anything installed locally, and just try things out in the browser, in a nice, fun, interactive way.