4 ms·
The hilarious bit is that they dropped Java for Python, probably due to the massive levels of frustration encountered when trying to do simple things like this.
by technomancy 17y ago
The hilarious bit is that they dropped Java for Python, probably due to the massive levels of frustration encountered when trying to do simple things like this.
- litewulf 17y agoIn practice, almost all core code is C++/Java (vast majority is C++, though its slowly shifting), with Python relegated mainly to scripting glue.
- qw 17y agoIt was simple. This is the code he had to use (assuming he used URLConnection) connection.setRequestProperty ("User-agent", "GoogleBot/0.01"); I had never done this before and found it out by looking at the javadoc. I don't see how switching to Python would have made this easier.
- simplegeek 17y agoMay be older versions of Java didn't support this or didn't document it properly--just saying?
- pyre 17y agoWhat version was he running? Wikipedia's history of Java verions says 1.0, as does the request string in the article. [http://en.wikipedia.org/wiki/Java_version_history http://en.wikipedia.org/wiki/Java_version_history] Was URLConnection available back then? According to the URLConnection docs it's been around since JDK 1.0. [http://java.sun.com/j2se/1.3/docs/api/java/net/URLConnection.html http://java.sun.com/j2se/1.3/docs/api/java/net/URLConnection...] Did URLConnection.SetRequestProperty exist back in JDK 1.0? The closest I could find were the docs for JDK 1.1.8 in a downloadable zip file, and yes SetRequestProperty existed back in JDK 1.1.8 at least. Looking at the actual response, and the JDK 1.1.8 docs, he would probably have been using HTTPURLConnection (could not find HttpClient anywhere in the jdk1.1.8 docs) and even HTTPURLConnection in JDK 1.1.8 I could not find the string 'agent' anywhere on the page. So yea, if the settings were there they were buried and not readily accessible in the documentation of the time.
- sonofjanoh 17y agoBottom line is that he saw potential in that setting...and what potential!
- simplegeek 17y agoI was simply curious, thanks for digging in :)
- jdale27 17y agohttp://www.aquaphoenix.com/ref/jdk1.0.2_api/java.net.URLConnection.html http://www.aquaphoenix.com/ref/jdk1.0.2_api/java.net.URLConn... setRequestProperty is there.
- pyre 17y agoYea, but there still isn't anything in those docs referring to the User-Agent string/property.
- cdr 17y agoYou did that in 1996?
- axod 17y agoSetting a user-agent isn't exactly a core language thing. HTTP is an add-on library, of which there are many to choose from. I know you saw the title and thought "ahahaha easy time to bash Java again", but it's really ignorant to do so.
- jhancock 17y agoIt is reasonable to recall that Java was being promoted in 1996 as the "net" language, yet lacked basic mature libraries for being so. Java only became a decent language with mature libs after many years of front running this position. Some of us that used Java early on, mainly because business drivers forced it on us (Sun/IBM/BEA wouldn't lie to corporate America?), don't have fond memories.
- tedunangst 17y agoWhat was python being promoted as in 1996?
- jhancock 17y agono idea. I'm not even sure that in 1996 I had heard of python. Not sure why folks on this thread want to keep bringing python into the mix, especially in a 1996 context. Others have stated that python isn't and never has been the core to Google's search engine.
- basugasubaku 17y agoAccording to their 1998 paper (http://infolab.stanford.edu/~backrub/google.html http://infolab.stanford.edu/~backrub/google.html): "Most of Google is implemented in C or C++ for efficiency and can run in either Solaris or Linux." and also "Both the URLserver and the crawlers are implemented in Python." So at some point they decided to try out Python for certain tasks.