Goings on at Softwire, technical and otherwise

Google Code Search is dead

One of the best online tools for programmers, Google Code Search, is now dead. This amazing tool was very useful for looking through open source code. You could just type in a class name, or an error string, and be taken instantaneously to a hyperlinked, browseable source listing. This search engine was one of my most used bookmarks.

So what can we use instead?

  • In many cases your IDE debugger will provide the information you want – and often in a more useful fashion.
  • Otherwise, there are plenty of other search engines you can try.

IDE debuggers

Java

For Java, if you have Eclipse set up properly (especially on a Maven project), it should be able to auto-download source for most of your JARs. You can control+click on a type name, and (after a short pause on the first occasion), Eclipse will show you the source. Of course, the search functionality is not as good as Google, but you can still right click on types and members and choose “find references”. Eclipse will search inside all your JARs, as well as in your workspace. You can even debug inside the 3rd party code. When this works, this is often even better than GCS.

There are a few JARs whose owners don’t properly upload the source to Maven, so this won’t work. See the other options below for these.

I would expect other Java IDEs to have similar functionality, but I haven’t tried any recently.

C#

For C#, Visual Studio has very similar functionality, especially if you have ReSharper installed, which takes care of connecting you to a Debugging Symbol server and even decompiling 3rd party code on the fly. Just as for Eclipse, you can debug inside 3rd party code.

While these both work very well for debugging 3rd party code, there is a major use case of GCS which they don’t meet, which is finding examples of APIs in use.

Other search engines

There are a few other search engines which attempt to do the same thing that GCS did.
The discussion at the closing announcement of Google Code Search links to a few, including the following:

http://koders.com/ attempts to do much the same as GCS, and works OKish. They have been promising a major update for some time, so it could be about to get a lot better.

http://grepcode.com is tolerable, but a bit ugly and Java only. It’s a little better than Koders for Java-specific searches. The source code is weirdly formatted — comments are HTML/javadoc formatted inline with the source, which is jarring, but OK once you get used to it.

http://searchco.de/. This search engine is code-focussed, but isn’t quite a drop-in replacement for GCS. All the Java searches I tried linked to JavaDoc, rather than source code. It might be useful for searching for programming terms which contain symbols or which are ambiguous with non-software terms.

If anyone has any better suggestions, or thoughts on the above, please let us know below!

Tags: ,

6 Responses to “Google Code Search is dead”

  1. Ben Boyter says:

    Hi Richard.

    I am the author of searchco.de Thanks for trying it.

    To alleviate the issue where people cannot find code I have switched it over to search code by default rather then through regex syntax or using the checkbox. This should resolve your issue I would hope.

    Let me know if you have any bad queries or experiences and I will be sure to get onto it ponto for you.

    Ben

  2. Susie Bily says:

    Hi! I’m the product manager for koders. Development work is underway! The source for the code search will be ohloh.net projects and their code enlistments. We have more scalability work to do. Check out Code Sight to get a preview of the UI coming in Koders (filters, etc.). We’re still adding search bundling, preserving-the-underscore, more parsing, and an architecture change to allow one project to have many code enlistments. lots to do… but we’re getting there! @koders

  3. Hi Ben,

    Thanks for your reply.

    As one difficult example, recently I was trying to find the source code to “org.apache.soap.rpc.Call” (this seems to be a very old Apache SOAP library which is still floating around the internet — in the end I couldn’t find it without help — see http://stackoverflow.com/questions/9133160 ).

    How can I find this on searchco.de? There’s no way to search based on the filename (which I used to use on GCS with e.g. “file:org.apache.soap.rpc”). I tried searching for http://searchco.de/?q=%2Fpackage+org.apache.soap.rpc%2F&cs=on — but no match. It looks like you just haven’t indexed the code (it is pretty obscure), as the same approach works fine for other class searches: http://searchco.de/?q=%2Fpackage+org.apache.commons.lang%2F&cs=on.

    GCS used to hyperlink the imports in a Java file to go to the relevant classes in the same repos (or search globally if they were library imports), but that’s definitely a nice to have.

    I like what you’ve done. I’m definitely going to bookmark this and try it for a few weeks.

  4. Hi Susie,

    Thanks for your reply. I’ll keep an eye out for your update.

  5. Ben Boyter says:

    @Richard Bradley

    It seems that I still haven’t gotten around to indexing it yet. To point out however you can search on filename. You can add the following ext:java to any search term (outside the regex) and it will restrict to java extentions (or indeed pretty much any extention you can think of), EG http://searchco.de/?q=%2Fpackage+org.apache.soap.rpc%2F+ext%3Ajava&cs=on

    I still need to increase the size of the index. I have about 2 billion lines of code indexed thus far and I am adding live index support now at which point I will include any code I find as I go. This should allow the index to grow at a much faster rate then it currently is.

  6. Hi Ben,

    I was trying to look at the Sun SAAJ code, and couldn’t find it on search[/code]:

    http://searchco.de/?q=%2Fpackage+com.sun.xml.internal.messaging.saaj.soap%2F&cs=on

    However, a standard google search:

    http://www.google.co.uk/webhp?q=%22package%20com.sun.xml.internal.messaging.saaj.soap%22

    leads to:

    http://javasourcecode.org/html/open-source/jdk/jdk-6u23/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java.html

    Did I search wrongly with the first search? Or do you not have this code indexed yet?

    Thanks,

    Rich


Leave a Reply


* seven = 35