I’m finally getting around to posting some notes from my second day at the Google I/O conference.
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.
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.
(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
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