Comparison of Source Code Search Engines


Picture:Clock Published on September 6th, 2006 in Best of, Programming

Inspired by my last post about the O’Reilly Labs website that let’s you search for source code, I did some more thorough research. Now guess what? I’ve made a table comparing them all, since some have less content, like O’Reilly for example, but offer better quality and some detailed explanation, while others provide plenty of content but just for one programming language. But see for yourself:

Site Languages Supported Content
csourcesearch.net C and C++ over 283,421,294 lines of code
 

Comments:

Probably the biggest C / C++ resource.

QuickRef.org C, C++, CSS, HTML, HTML DOM, Java, JavaScript, MySQL, Perl, PHP, and Ruby

Provided by others:

  • cppreference.com (C++)
  • developer.mozilla.org (JavaScript, HTML DOM)
  • php.net (PHP)
  • search.cpan.org (Perl)
  • search.cpan.org (Ruby)
  • w3c.org (CSS, HTML)
  • and others
  Comments:

  • Is a meta search engine
  • Has a great ajaxified search box, so that a search about “System.Time” will show you subsequent hits as well
Koders Ada, ASP, Assembler, C, C#, C++, ColdFusion, Delphi, Eiffel, Erlang, Fortran, Java, JavaScript, JSP, Lisp, Lua, Mathematica, Matlab, ObjectiveC, Perl, PHP, Prolog, Python, Ruby, Scheme, Smalltalk, SQL, Tcl, VB, VB.NET over 225,816,744 lines of code
  Comments:

  • Let’s you also search for code after its license type
  • Has been named in 2006 as the leader in code search by SD Times
  • Provides plug-ins for Eclipse & Visual Studio to enable integrated search from these IDEs
ByteMyCode JavaScript, VBScript, Java, PHP, CSS, CSharp, HTML, C, C++, ASP, Python, Perl, VB.NET 345 Snippets
  Comments:

  • Pursuits a more social way with members and the ability to vote for code
  • Members post snippets and since the site is still pretty young, there aren’t that many snippets available yet. But the site looks promising, so it might become a valuable resource in the future.
Planet Source Code Visual Basic, ASP, .Net, Java, Javascript, C, C++, SQL, Perl, Delphi, PHP, Cold Fusion over 11,826,054 lines of code
  Comments:

  • Pursuits a more social way with members and the ability to vote for code
O’Reilly Code Search Visual Basic, ASP, .Net, Java, Javascript, C, C++, SQL, Perl, Delphi, PHP, Cold Fusion over 2,600,000 lines of code and over 123,000 individual examples
  Comments:

  • Since all of the code examples are taken from O’Reilly books (which are according to many people the best IT books in the world), these examples probably provide the best quality you’ll find

And so here are my recommendations:

1st Place: O’Reilly
Because it is a good starting point for almost any programmer to search for code. The reason why you should start with O’Reilly is simply that the code you’ll find here will not only work, but is also beautifully written and well-formed.

2nd Place: QuickRef
QuickRef offers a great AJAXified interface that let’s you find source code for something you don’t even exactly know the name of. It also shows you related info based on your search which is useful for further research you might not even have thought about before. The resources QuickRef uses (it’s a meta search engine) are great and well-respected websites on their own, thus the source code should be of high quality most of the time.

3rd Place: Koders
Koders is a great resource as well. It might often be the last place of hope to find source code to programmers coding in more exotic languages like Ada and Eiffel. But it should be also of great value to more mainstream programmers using Java or C++.

Summary
You should use a combination of these search engines for your daily work, because all of them use different resources, so you might be able to find source code for a specific problem with one search engine, while you might not succeed with another one. So, it might be a good idea to bookmark this page for your future reference. I will also update it as soon as I find out about a new one.

Hope this helps you guys to write better code, more efficiently. It certainly helped me.

Update: There’s a new kid in town called Codefetch, after some reviewing I’ll update the comparison appropriately.

Share This

Trackback URL for this post:
http://www.yatblog.com/2006/09/06/comparison-source-code-search-engines/trackback/


3 comments

    Wayne Brehaut October 29th, 2006

    O’Reilly also includes Python examples, missing from your list above.

    w

    HelloWorld April 28th, 2007

    Peace people

    We love you

    [...] Comparison of Source Code Search Engines | Yet another Tech Blog (tags: comparison development programming source code search engine) [...]

Shout it out!