Google I/O: Day 2 Notes

I’m finally getting around to posting some notes from my second day at the Google I/O conference.

Keynote

The keynote speaker was Marissa Mayer, who was more interesting for me because she talked a lot about how Google does statistical research for everything they release. They’ll release two or three versions of, say, the search results page, and see which one does better. Easy for them because they have millions upon millions of users, so they can detect differences in such minutes differences as the amount of whitespace between the header and the results.

Java

I attended a talk by Joshua Bloch, author of Effective Java (which we have), about the new features of Java 5. He was a fun speaker, very enjoyable.

Wildcard types are a new Java 5 feature, where you can use ? to declare methods that take super or sub classes. For wildcard types, he had a mnemonic for remembering how to declare a method.

PECS

(Easy to remember because he showed a picture of our governor’s pects.)

Producer Extends, Consumer Super

What this means is that if your argument is a Producer of a type, you should declare the method as <? extends E> (where E represents your class), and if your argument is a Consumer, you should declare the method as <? super E>.  Here is an example:

void pushAll(Collection<? extends E> source); // A method that pushes all of source onto this.

Since source is producing E’s, declare it as <? extends E>.

void popAll(Collection<? super E> destination);  // A method that pops all of this onto destination.

Since destination is a Consumer of E’s, declare it as <? super E>.

Google Visualization API

Google has this visualization API that aims to provide a standard system for providing data to some sort of graphing function in JavaScript. So they have a standard way of representing data to the JavaScript grapher, and an API for how to write those graphers. They have some written that do like pie charts and line charts, and other companies have written their own and released them as well.

Creating a chart is supposed to be as easy as creating the Data Table, which is basically a 2D array of data, and passing it to the visualization, which draws the chart into the DOM.

After that, you can dynamically change the chart by changing the data. Events and page actions let charts communicate to each other and update each other, as well.

Search Friendly Development

This presentation was about how to keep your website friendly to the crawlers, especially Google’s. Most of the things were stuff that we’ve done at one time or another, but here’s some random bullet reminders:

  • Keep every page accessible without forms or cookies
  • Use static HTML links for navigation, not AJAX or Flash
  • Don’t try to have two separate sites, one for Flash and one for static HTML
  • For rich media (Flash, videos), use one page per item
  • Images should have descriptive text near the image, and also descriptive alt text
  • On the web server, you can use the if-modified-since header to reduce crawling
  • For indexing, choose either the www.blahblah domain or the blahblah domain, and use a 301 redirect from the other one, so that all of the traffic gets assigned to just one, increasing your score
  • Avoid unnecessary URL parameters
  • If you have a sitemap, declare it in robots.txt. That lets all crawlers who understand it to access your sitemap.
  • 301 transfers should be used for any permanent redirects, because this links the popularity of the old URL to the new one.
  • Use descriptive title metatags so that when your page appears in search results, the snippet looks attractive

GWT Extreme

The last presentation I went to was about some crazy uses of GWT. It was mostly over my head, but it was pretty impressive. The one part I did understand was that he had re-written the jQuery library in GWT, and the produced JavaScript was much smaller than jQuery. That was pretty cool.

Leave a Reply