Google Labs has launched a new search engine just for you, software developers that is. Google Code Search can help all programmers by quickly filtering billions of lines of source code, all from the default and familiar search interface, to reveal reusable code-snippets. Be it a specific programming term or language, or diving headlong into some compressed code on a hunt for very specific features, Google Code Search would seem to have it all.
Including the ability to focus a search on code based upon specific licensing requirements, which could mean that it is just as much a friend to the lawyers as the programmers when it comes to defending potential patent litigation.
So what exactly can you search for, and how exactly do you do it?
Well how about regexp for a regular expression search such looking for the likes of go{2}gle hello,\ world and ^int printk for starters. Then there is the exact string search for something like ‘compiler happy’ for example. Maybe you want to search only in files or directories matching regexp, in which case you could use file:regexp for file:\.js$ XMLHttpRequest. Whereas package:regexp will search packages with names matching regexp, where a package's name is its URL or CVS server information so something like package:perl Frodo or package:linux-2.6 int\ printk. Then there is lang:regexp to restrict the search only for programs written in languages matching regexp such as lang:lisp xml or lang:"c++" sprintf.*%s, and license:regexp to restrict just for files with licenses matching regexp such as license:bsd int\ printf or -license:gpl quicksort.
What you won’t get is the human touch, that added expert knowledge that you find at DaniWeb, so don’t think for a minute that this is some kind of threat to us here or a direct replacement. Indeed, it can actually help you locate code within DaniWeb as I quickly found out when testing the service. What Google Code Search is, then, is another invaluable tool in your development armory, and one that doesn’t require membership of a subscription based code repository, or rather repositories as many are focused on a specific software class. Use it to find that code segment, but come here to understand what it means and get the help you need in using it...