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. Re:What's that I hear???? by bluelip · · Score: 2, Insightful

    _OR_, the sound of thousands of Profs moaning.....

    --

    Yep, I never spell check.
    More incorrect spellings can be found he
  2. A good start.. by sfraggle · · Score: 5, Insightful

    It's a good start. They really need to start searching Subversion/CVS repositories as well. One of the most obvious things that they seem to have missed is to index all the Sourceforge downloads.

    --
    were you expecting to see a sig here? perhaps you'd rather see the inside of an ambulance!
  3. security hole search by Sub+Zero+992 · · Score: 5, Insightful
    --
    They who would give up an essential liberty for temporary security, deserve neither liberty or security - Ben Franklin
  4. Re:COBOL hasn't been topdog for a while by doti · · Score: 4, Insightful

    It's true that not a lot of people write COBOL today, but the submiter was talking about legacy code. No wonder they're not on the Internet: not only they are from a pre-Internet era, but the vast majority of it is from corporations that keep their code very closed.

    --
    factor 966971: 966971
  5. Re:What's that I hear???? by Gospodin · · Score: 3, Insightful

    Why? This makes it easier to check for plagiarism.

    --
    ...following the principles of Heisenburger's Uncertain Cat...
  6. Re:Useful to whom? by admdrew · · Score: 3, Insightful

    If you're unaware of how to do something from a design standpoint, you're right that viewing code is not necessarily going to help. This tool, however, works great for more specific issues related to syntax, etc. I've already used this to see examples of ItemTemplate in C#. A simple search on regular google yields examples, but it also returns a lot of crap.

    When considering TMTOWTDI, looking at other code similiar to yours can be very helpful, and (for me, at least) can help break out of a code writers block when I've been working with a particular chunk of code for too long.

  7. Re:What's that I hear???? by SpinyNorman · · Score: 2, Insightful

    Not really, you can just tokenize the code, removing the issue of white space, comments and formatting completely, and just treat identifiers as a token type vs even looking at the name - then you're just doing a pure structural comparison of the code. Plenty of other things you could do too to normalize the code and factor out any trivial rewritings (changing parenthesis, etc).

    Any smart code comparison would look for function by function matches to factor out trivial reordering, and would anyways operate on a diff-like basic looking for changes rather than a yes/no match.

    Net result is that a smart code compare tool would not be fooled in the slightest if you completely reformatted the code, changed all the identifiers and comments, reordered all the functions, and even rewrote a few pieces for good measure - it'd still show a 95% match with the original, which for anything more than a trivial fucntion would be almost certain proof that id had been copied.

    Ben