Slashdot Mirror


Google Unveils Code Search

derek_farn writes, "Google now has a page that supports source code searching. I hope they extend it to be more programming-language aware (e.g., search for identifiers and functions) like the specialist code search sites (Krugle, Koders, and Codease), who probably now have very worried investors. I don't see any option to search for Cobol. I guess there is not a lot of Cobol source available on the Internet, even although there is supposed to be more Cobol source in existence than any other language (perhaps that statement is not true in the noughties)." From the Cnet.com article: "Google engineers, many of whom participate in open-source projects, already use these code searching capabilities internally. Since it is a Google Labs project, the company is not yet seeking to monetize searches through ads."

7 of 212 comments (clear)

  1. Non-alphanumerics at last! by maccallr · · Score: 4, Informative

    At last we can use regexps and search on all the important characters between the alphanumerics! For example the prefixed '@' in PHP - very hard to figure out what this is, without reading the reference cover to cover. Now at least we can search the codebase and hope to see some useful comments preceding it, or figure out from context what's going on.

    e.g. "@fopen file:.php"

    1. Re:Non-alphanumerics at last! by serialdogma · · Score: 2, Informative

      The @ prefix in PHP just stops it from printing an error message if something goes tits-up.

    2. Re:Non-alphanumerics at last! by fruey · · Score: 2, Informative

      Not only stops it from printing an error, but ignores the error and carries on parsing the rest of the code.

      Useful for including a file that might not be there, for example...

      --
      Conversion Rate Optimisation French / English consultant
  2. "Given enough eyeballs... by bloblu · · Score: 3, Informative

    all bugs are shallow."

    Well, it looks like that's not really the case: http://www.google.com/codesearch?hl=en&lr=&q=++%5C sif%5C(%5B%5E)%5D*%5C)%3B+license%3Agpl+lang%3Ac%2 B%2B&btnG=Search

    I hope this service will help improve code quality...

  3. Re:security hole search by RalphSleigh · · Score: 2, Informative

    Mmmmm, SQL injection for the world to see. Good Call.

    --
    Come as you are, do what you must, be who you will.
  4. Re:A good start.. by Slurfer · · Score: 3, Informative

    According to the help / FAQ page, they are searching cvs & subversion repositories.

  5. Re:the one thing everyone will search by Anonymous Coward · · Score: 4, Informative

    You can also find some unfunny stuff too!

    This could be abused by email spammers.
    Search for: http://www.google.com/codesearch?q=%40

    This reveals a lot of email addresses in code.
    It's giving the spammers email addresses on a plate. (within a geek targeted audience)
    That's definitely not funny but scary.