Google Wave Samples Gallery: Best Practices & New Features

Thursday, October 15, 2009 | 6:11 PM

Labels:

The Google Wave Samples Gallery has been a great way to see what developers have been creating and find starter code to build on. We added a search box to enable developers to find what they're looking for, but we heard that it still wasn't easy to find examples of code that uses a particular class/method or does one particular task. So, we've added a few new features to the gallery:

Best Practices

Some samples just demonstrate a fun and inspiring use of the API, but others demonstrate a nice use of a particular API feature, like how a robot can set the state of a gadget, or how a gadget can store per-participant keys. We wanted to call out these samples and make them easier to find, so we've added a "best practice" badge, highlighted these samples on the front page, and added a filter. We've also added a form field to the submit page, so that developers can tell us what aspects of the APIs their sample shows off.

Indexed Code Repositories

When a developer submits a sample, they must also submit a URL that points at their source code. Most of the time, this URL is to a public SVN or GIT repository. We've now added these URLs to the custom search engine that powers the search box, so that when you search, you'll also get results from code files. This makes it easier to find usage of particular parts of the API. Search for "GetDocument" as an example.

Code Snippets

When a developer submits a sample, they can specify that they're submitting a "Code Snippet" or a "Working Sample". With a code snippet, instead of providing links to the robot address, gadget XML, or installer XML, they need only to provide useful lines of code. You can use this to share some bit of code that you've written, even if you don't want to share the whole sample. And if at some point you want to change a snippet into a working sample, you can do that. Check out my Send Email from a Robot snippet for an example.

We hope that you will find these new features useful while you're designing your own Wave-y extensions. And, don't forget to subscribe to the recent samples ATOM feed to find out about new samples in the gallery.