Sunday, March 11, 2007

Google invented AJAX? WTF?

When it comes to software development, Google's Adam Bosworth has a need for speed.

In a talk entitled "Physics, Speed and Psychology: What Works and What Doesn't in Software, and Why," Bosworth, a vice president at Google, discussed why technologies such as AJAX (Asynchronous JavaScript and XML), PDAs and natural language failed to catch on in the past but are successful today. Bosworth spoke at Google's offices here as part of the Google NYC Speaker Series on Jan. 29.

Bosworth said he has been building software for about 30 years and "not all of it works" all the time. "The reason, on reflection, turned out to largely depend on physics and human psychology," he said. And "a lot of it had to do with Tom Cruise," Bosworth said, citing the actor's line in the movie "Top Gun" where Cruise says, "I feel the need, the need for speed."
Indeed, speed or lack thereof has played a role in hampering the success of various software innovations, including AJAX, Bosworth said. Had chips been a little faster and broadband been more ubiquitous, AJAX might have caught on a lot faster. However, the physics of the technology was only one of the factors holding AJAX back.

"Back in '96-'97, me and a group of people, many of whom are here at Google, helped build stuff that these days is called AJAX," Bosworth said. "We sat down and took a hard look at what was going to happen with the Internet and we concluded, in the face of unyielding opposition and animosity from virtually every senior person at Microsoft, that the thick client was on its way out and it was going to be replaced by browser-based apps.

"Saying this at Microsoft back in '96 was roughly equivalent to throwing matches around in an oil refinery," he said. "But we concluded we should go and build this thing. And we put all this stuff together so people could build thin-client applications."

That was 10 years ago. "Now you hear about AJAX all the time, but this was built in '97," Bosworth said. Yet, AJAX failed for a variety of reasons, including some "big mistakes."
The mistakes, he said, were misperceptions of the realities of the way people would use the technology.

For instance, Bosworth said a cardinal rule of his is KISS, or, in his words, "Keep It Simple and Stupid." Gestures like tooling, icons, right-click and drag-drop are too obscure, he said.
Moreover, most Web applications are designed for large numbers of customers with small amounts of customer support, and most Web applications are not used for hours a day, he said.
Also, "You don't need to remember how an app works," Bosworth said. "There's a big difference between making something easy to use and making it productive." In other words, just because people can easily learn to use an application doesn't mean using the application will make them more productive.

In addition to these mistakes, the physics for AJAX were wrong in 1997, Bosworth said. For example, real applications turned out to need a lot of JavaScript, and, "In 1997 most modems were 19.2 and chips were 100 times slower than today," he said. Also, most applications either needed a large or unpredictable amount of data to flow over them or really fast on-demand loading of data, Bosworth said.

"In short, real apps were hideously slow," he said. The "physics" limitations hampered JavaScript, and the alternative, Java, "was just too slow to have to move everything through a VM [virtual machine]," Bosworth said.

To illustrate his point, Bosworth asked the audience to imagine a keyboard where there's a 10-second lag before what you type appears on the screen. "You don't get a pencil and start writing and it takes 10 seconds to get on the page," he said.

A good tool should be transparent, should execute actions in less than half a second and should involve interactive bottom-up learning, "because you change your mind as you go," he said.
However, in the end, AJAX got a second life, primarily because the physics changed, Bosworth said

For one thing, the use of broadband soared suddenly, and then chips became "massively faster" than they had been in 1997. This helped make carefully crafted applications "quick enough," though it's still hard to write these applications, Bosworth said.

Meanwhile, usage also changed. "A large number of people started using Web applications more than once a day," particularly for functions like e-mail, calendars, social networking and trading.
Another technology that was "an impressively bad failure for a long time" was the PDA, Bosworth said.

PDA makers struggled with pen computing. Then Palm came along with its Graffiti. Then the BlackBerry and the Treo brought in keyboards, which helped usher in greater adoption for PDAs. Also, browsing on PDAs initially failed, but came back because of speed. Browsing on PDAs got a second life from options like EvDO (Evolution Data Optimized) and EDGE (Enhanced Data for Global Evolution) networks, Bosworth said.

Natural language technology also initially failed to become the panacea many predicted it would be, he said.

Natural language was billed as a replacement for the GUI, but it failed to achieve that. It also failed as a query language for databases, as a calculation language for spreadsheets and as a document creation language, Bosworth said. "Humans expect a human level of comprehension," he said, noting that database queries and spreadsheet formulas have to be exact.
But natural language got a second life, too, triggered in part by Microsoft Help, and the next step turned out to be Google, Bosworth said. The trick to being successful with natural language is to "start with a fuzzy problem, one no human can resolve anyway…orient it around search, and the magic is just in the ranking," he said.

Drawing on the lessons he learned from the initial failure of AJAX, Bosworth admonished developers to think about user activity. "Ask what the frequency is," he said. "Unless an app is used over and over each day, make it simple, even if more clicks [or] pages are required."
Also, "Ask how long it takes to execute a requested task," he said. "If it takes more than 2 seconds, consider not providing the task or splitting it up into small, user-controlled tasks."
Moreover, "sites where people don't go a lot don't need AJAX-style UIs [user interfaces]," Bosworth said. "If we started building AJAX for AJAX's sake we wouldn't be doing our customers any favors."

As Bosworth spoke, Google staffers could be seen—through a window separating the auditorium from a work area—riding Razor scooters up and down the hall. Bosworth joked about being a POF, or Pontificating Old Fart.

"It feels very old to be working at Google," Bosworth said after his talk. And during a part in his talk where he mentioned Lotus and its foray into natural language, he asked: "How many here have heard of Lotus?" Several hands went up, and Bosworth said, "This must be a pretty old audience. Most Google audiences don't know about Lotus."

The purpose of the talk was to examine what does or doesn't work in the development of software, Bosworth said. All in all, he achieved what he set out to do.

"I've spent a long time building software. I wanted to be an architect when I was in college, but I had two things going against me: One is I can't draw and another is I have no head for structural engineering," Bosworth said.

"So I found something I could do better, which is building software," said Bosworth, a contributor to AJAX, XML, BEA Systems' WebLogic Workshop, Microsoft Internet Explorer, Microsoft Access and many other technologies.

No comments:





Google