Yet again Google delivers. This time they provide us with Google /*Code Search*/ which searches through
millions and millions of lines of open source code. By default it searches through all code available, but if you hit the Advanced Code Search link, you can preset a specific language as well as adjust some other preferences. As for regular Google search, these options are also available from the search box so if you for instance are a bit curious on how to write an if statement in C#, you'd just time something along the line of if lang:C#.