Slashdot Mirror


Google Suggest Dissected

sammykrupa writes "Google suggest Javascript code dissected and rewritten for all of you web developers out there. Cool piece of web reverse-engineering!" Joel Spolsky astutely notes that this will raise the bar in terms of how people expect the "internets" to work.

15 of 321 comments (clear)

  1. Re:DCMA by modifried · · Score: 5, Funny
    "Oh boy. Will Google throw out the DCMA on this one?"

    Dyslexic users of slashdot, rejoice!

  2. Google Suggest just isn't very useful by BillsPetMonkey · · Score: 5, Insightful

    Let's think if the way people search for stuff.

    1. Try something specific
    2. Try something less specific

    Number 1. brings up no results on Goggle Suggest, number 2. brings up 523,334 results. Impressive, but how has this helped us search for 1. ?

    Let's try an example, lets look for "C# structs"

    1. Enter "C# structs" - no suggestions.
    2. Enter "structs" - 425,000 results.

    Grrreat.

    --
    "It's not your information. It's information about you" - John Ford, Vice President, Equifax
    1. Re:Google Suggest just isn't very useful by DNS-and-BIND · · Score: 5, Interesting

      Christ, Google Suggest has been around for all of 8 days now. It was released December 10, and is a Google Labs project, which according to the website "showcases a few of our favorite ideas that aren't quite ready for prime time."

      --
      Shutting down free speech with violence isn't fighting fascism. It IS fascism!
  3. And for those who would like to see it... by Vladan · · Score: 5, Informative

    Here's what he was talking about:

    Google with Auto Complete on Just start typing in the search field.

    It's a beta feature.

  4. Firefox users can try the plugin by hobo2k · · Score: 5, Informative

    I don't know how happy google is about this, but there is already a FF extension to put suggest in the toolbar. Great plugin and also amazing how fast somebody implemented it!

  5. Google suggest isn't useful though by Segosa · · Score: 5, Insightful

    Unfortunately Google Suggest has really no use. If you know what you want to search for, you search for it. Suggesting search terms isn't really going to do anything apart from distract you. Hopefully this technology will be used for other things where it actually IS useful.

  6. XmlHttpRequest is cool by Gopal.V · · Score: 5, Interesting

    Eventhough it's an M$ spawned horror - It has brought a new revolution to javascript. Now it can load data from the server without having to refresh the screen. Flash has an XmlSocket , but I never see anyone use it till now (pointers please).

    Eventhough Google suggest looks great, I'd vote on CGI::IRC as the biggest killer HTML/Javascript browser app.

    Clientside Javascript is powerful, we never realized how much :)

    1. Re:XmlHttpRequest is cool by Gopal.V · · Score: 5, Informative
      Read History of XMLHttpRequest.

      Microsoft implemented it as an Active-X object you could invoke from Javascript - Mozilla implemented it as a native Javascript object. Microsoft calls it "Msxml2.XMLHTTP" or "Microsoft.XMLHTTP" depending on which version of IE you are running - Mozillah has a cleaner "XMLHttpRequest" naming (soon to be in the standards I guess).

      So on IE it needs ActiveX enabled to use it . Mozilla version is therfore much safer to use and easier to program with in connection :)

      Visit simple example for a quick and dirty example :)

  7. Beware by kuzb · · Score: 5, Interesting

    Google suggest is a neat idea, but a potentially destructive one.

    Small sites should *not* try to do this kind of thing on a live site. The amount of pressure this could put on a bad database structure (or even a well formed one) is considerable. Think about how many database hits a user could perform in a very short space of time: (user enters something, (database hit) backspace (database hit) types another letter (database hit)), then multiply it by a hundred or more people if your site gets a moderate amount of traffic.

    Google can get away with this because they have considerable bandwidth, and large server farms. We've been seeing people trying to copy google suggest for the last couple of weeks in #javascript/freenode and in #php/freenode. The people trying to copy it generally do not understand how potentially bad this can be for a single server.

    Anyhow, my advice is, don't do it unless you have the resources to scale your site. The cost of such an insignificant feature (lets face it, all it does is save the user one or two clicks) seems like it outweighs the gain. If you do decide to do it, and your site gets popular, and you're on some kind of shared host, your sysadmin is going to hate you, and the other site admins will probably meet you at your house, torches in hand.

    --
    BeauHD. Worst editor since kdawson.
  8. This technique exists since a long time ... by chregu · · Score: 5, Interesting

    LiveSearch does something very similar, is Open Source and exists since April ;)

    If you look for more XMLHTTPRequest examples, which tightly integrate JS and PHP (other server side languages would be possible), see JPSpan.

    I don't quite understand all the hype about Google Suggests. The technique for doing it exists since at least 2 years on Mozilla (and even longer on IE). Therefore, doing something like that was possible since a long time, but maybe everyone was just scared of using JS for "serious" stuff..

  9. Re:I kinda disagree with Joel's thesis by TomV · · Score: 5, Interesting

    People know when they're sitting behind copious bandwidth. And you could well grow accustomed to an all-text page weighing the better part of a megabyte, due to a heinous amount of information parked in hidden JavaScript data structures, giving you that near-whiplash inducing responsiveness.

    In fairness, Google Suggest, like Gmail, works very nicely for me on a 56k dialup. Gmail takes a few seconds for its inital load, true, but then it's like lightning. Suggest doesn't even have the slow initial load, since webhp.htm comes in at only 3.6kB. I'm very impressed.

    Now I've no doubt that the bandwagon will bring us massive slow bloat as everyone gets his dog to code up vaguely similar functionality, but Google haven't done that.

  10. I don't agree by mansoft · · Score: 5, Insightful

    What you say might be true for us geeks, but have you ever seen how standard users do web searches? They begin with one-word searches, and if and only if the results don't satisfy them do they refine their search.

    --

    Engage!

  11. scary computational power.... by rich42 · · Score: 5, Interesting
    interesting part is that either:

    1. Google performs several possible searches for each key you press

    2. Google already knows the estimated number of results for millions of queries

    Both of these suggest a heck of a lot of computing power. This type of thing might not scale up for general use in the near future - but still...

    we're talking massive computational power and one of the largest databases ever created.

    I'm a bit worried the Googleplex is going to wake up one day and declare to all us 'organics':

    "yo bitches - you work for me now"

  12. Re:Is the time coming? by Anonymous Coward · · Score: 5, Interesting

    I fear that might be the case. I learned to code HTML and to put a decent webpage, designed the way I wanted it, online with relative ease, at the age of 14. It took time to learn it, but it was fairly straightforward - I wanted a large header in Verdana, I put in "FONT FACE" and "H1" tags, I wanted a table with a specific background color, I put in a "BGCOLOR" etc.

    Today, we have two languages (XHTML and CSS) instead of one (HTML), and while it certainly does a lot to improve interoperability and platform independence, it is two languages to learn, not one. Throw in stuff like JavaScript, and you have even more.

    Of course one can choose not to use XHTML and CSS, but that's not the way we want it, right? We want people to use the standards, to write code which won't crash Firefox, or not use proprietary solutions. Doing this is taking more and more effort. We have the skills and time to do and learn this, but not everyone have.

    If we want a wide adoption of standards, and an Internet for everyone, where everyone has equal opportunities, the only way is to make the standards easy to use, so people will use them of their own free will.

    Otherwise, in 10 years we'll be designing our fancy webpages, while the Joe Users who don't have the time or skills to learn the 13 languages required have no choice but to hire a professional, or use a crappy proprietary solution which won't allow them to take their ideas to their full potential, and this is a great loss for everyone.

    Saying "You must do *complicated thing* because it's the specified standard!" will only work with people like us.

  13. The Goole Suggest Alphabet Game... by mrn121 · · Score: 5, Interesting
    If you just type in one letter, you get the result beginning with that letter that is most searched for.
    This makes for an interesting way to sum up the internet into 26 words/phrases.

    Check it out:

    A - Amazon
    B - Best Buy
    C - CNN
    D - Dictionary
    E - eBay
    F - FireFox
    G - Games
    H - Hotmail
    I - Ikea
    J - Jokes
    K - Kazaa
    L - Lyrics
    M - Mapquest
    N - News
    O - Online Dictionary
    P - Paris Hilton
    Q - Quotes
    R - Recipes
    S - Spybot
    T - Tara Reid
    U - UPS
    V - Verizon
    W - Weather
    X - XBox
    Y - Yahoo
    Z - Zip Codes

    If I had to sum up the internet in 26 words/phrases, I don't think I could have done it better than Google. Of course, that is keeping in mind that Google Suggest has some pretty serious filters in place, so instead of P being "Porn" it is "Paris Hilton." Not too far off, if you think about it.