Google Code Search

Yesterday Google launched a new search for source code, this is such a great idea that I can’t believe its not happened before. You can search by a variety of languages, licence types and best of all by regular expressions.

There’s already been a lot of interesting, funny, and downright scary things turned up, best summed up By Jason Kottke. Some of the highlights includeprofanity, frustration and and of course losing all hope.

So far I’ve used this twice in the last two days for actual work, not just fucking around, which I found pretty impressive. I’ve already added a quick search in Firefox for PHP code, so I can just ‘grep function name‘.

I can imagine it being similar to the recent AOL search data being made public, we’ll be able to proverbally peek through other developer’s curtains and make snide comments on thier choice of upholstery (or naming convention).

I wouldn’t be suprised if stats from this end up used in a “Well the average perl function for this is 4 lines, it’s 8 for PHP, so it sucks!!!” way, but the statistics you could generate would be very interesting.

Of course over the next few weeks and months bad code will be probably be publicly mocked, exploits will be found people will panic and people will repeatedly search for swear words. But i’m sure that people are already working on tools to make this new search even better and more useful, and I can’t wait to see what else will come out of this.