Pandora.com sings with OpenLaszlo

13.02.2006
In ancient Greek mythology, Pandora, whose name means "all gifted," received many gifts from the gods, including the gift of music from Apollo. She was also very curious. Unlike those gods of old, who were displeased with Pandora's curiosity, the developers of Pandora.com say they celebrate that trait and have made it their mission to reward the musically curious with a never-ending experience of musical discovery.

Launched on Sept. 1, 2005, Pandora is a service designed to help users find and enjoy music that they'll love, says Tom Conrad, chief technical officer at Pandora Media Inc. in Oakland, Calif. The site, built using open-source software, is powered by what the company calls the Music Genome Project, which gives users an analysis of the musical characteristics of individual songs. To build Pandora, Conrad says, developers used OpenLaszlo, an open-source development platform for building rich, interactive Web applications, from Laszlo Systems Inc. in San Mateo, Calif.

On Pandora.com, a user enters the name of an artist or a song, and the service instantly creates a radio station that plays songs that share musical characteristics associated with the artist or song provided. From there, the user can fine-tune the station to his taste by giving Pandora feedback on the songs it plays. A user can make up to 100 unique stations that play all kinds of music -- pop, rock, jazz, electronica, hip-hop, old and new -- from a library of more than 300,000 songs from over 10,000 artists. Because Pandora is entirely Web-based, users don't need to install any software to start listening, Conrad says.

"We wanted to build an experience that was fundamentally about audio, not about hundreds of thousands of artists' pages and recommendation pages and lots of hyperlinking and this big Web site you come to," Conrad says. "Lots of other people have already done that. We wanted to build something that was really, really simple -- sort of a one-click radio [station]."

To do that, Pandora's developers wanted to have a rich, dynamic, engaging user experience that responded quickly to user input, played high-quality audio to the PC immediately and did not require the installation of an application or a bunch of plug-ins, Conrad says. So when the developers sat down to figure out how they would build it, they contemplated two options: the Dynamic HTML approach of Asynchronous JavaScript and XML (AJAX), or Macromedia Inc.'s Flash, which pointed them toward Laszlo, he says.

The AJAX approach, which is how Google Maps and Gmail are built, is an application development technique that lets the programmer get a more dynamic, rich-client kind of experience out of a Web browser. It allows the developer to build applications that have the interactive character of a desktop application but run in the Web browser, Conrad says. The other approach is to use Flash for the user interactions. Like AJAX, Flash has a high level of interactivity, as well as an experience that's more like a desktop application and less like the "point, click and wait" Web, says Conrad.

Pandora ultimately chose Flash, he says, because it has rich audio playback capabilities built in and fantastic cross-platform support.

"It's identical across all the browsers -- Linux, Windows, Macintosh -- whereas the AJAX approaches are built on JavaScript and DHTML, which are quite different from platform to platform in some cases," he says. While it was possible to create an AJAX application that would work across different browsers and operating systems, Pandora would have had to invest a substantial amount of work to make sure it achieved that same compatibility, Conrad says.

"It becomes very tricky in an AJAX application to get audio playback that's satisfying across platforms," Conrad says. "With Flash, you start with a much more level playing field because the Flash runtime is exactly the same on all the platforms."

Open-source Advantage

After settling on the Flash-based approach, Pandora had to decide how it was going to build its Flash application. The developers had three choices: Build it on the native Flash platform, which is designed more for animators than for programmers; use Macromedia's new Flex platform, which is closed-source software that's similar to OpenLaszlo but a relatively younger technology; or take the Laszlo approach. OpenLaszlo had two benefits: One was its maturity, and the other was the open-source nature of the product, which was very important to Pandora.

"Being able to have access to the source, to use that for debugging, to use that as protection against changes in the business environment of Laszlo, was hugely compelling for us," Conrad says.

Pandora senior developer Neil Mix, who created 80 percent of the OpenLaszlo portion of Pandora.com, agrees.

"The nice thing about open-source technology is that we can actually go in and look at how the software was actually built -- with closed-source software, you don't have that option, Mix says.

In about a week, he had built a prototype demonstration application of Pandora and had it fully functioning and working with the Laszlo software.

"That was an extremely fast turnaround, especially since I was programming in Flash," Mix says. Typically, the developers would have had to use Macromedia's software -- an expensive proposition -- or they would have had to devise their own programming system, which would be a very time-consuming and error-prone approach, Mix says.

"The Laszlo software solved all those problems right off the bat, was open-source and was very easy to develop in," he says.

Pandora was in development and beta for about eight months, Conrad says.

"That's a pretty phenomenally short development cycle for this kind of user experience," he says, "and that was facilitated by the ease with which one can construct really compelling user interactions using the OpenLaszlo platform.