AJAX vs Flash inside Yahoo!
DIGG IT!
29
Comments
Published
Wednesday, September 27, 2006
at
12:46 PM
.
In this interview with Kevin Cheng (Yahoo! Maps and Local) Kevin talks about the decision of the team to use Flash Player. The interview is revealing as it highlights the productivity and compatibility problems inherent in the AJAX development stack. For the record, I am NOT an AJAX fan and maybe its time I made this clear.
Here are a few paragraph from the interview:
JK: Why did you go with Flash opposed to the more widely used AJAX?
KC: Why not? I mentioned this in a blog entry when we released the beta. When I joined and found out we were using Flash, my gut reaction was, "why?" as well. I asked the typical questions and in all cases, got satisfactory answers. So let's run through them:
AJAX takes a lot of work. If you try hard enough, you can do almost anything with AJAX that Flash can do but the key phrase is "try hard enough". Part of the reason that Google Maps was such a surprise was not so much its interface (that's been done for years by MapPoint and other client based mapping tools) but the fact that they managed to accomplish this in a web browser. I think we were all just amazed that it was even possible. Except it wasn't - not in Linux, not in Safari.
Not only do you have to hack a lot to even get some things to work, you then have to hack some more to make it compatible with everything. Flash just works so long as you have Flash. Which brings me to my next point...
Depending on what numbers you listen to, the Flash install base is about the same, if not more, than the base of net users who have browsers capable of running JavaScript applications at the complexity of most AJAX mapping applications.
The design/geek community has a tendency to worship implementing something because it is hard to do. For example, you'll see articles about how somebody managed to do something with just CSS. Nevermind that it took twice the amount of code, numerous cross browser hacks and offers no additional accessibility, it's in CSS and validates! I feel like AJAX has that kind of community sometimes. "Look, I created this thing in AJAX - sure it's been done a gazillion times in Flash before but it's in AJAX!" Aside from the cross platform ease I mentioned, there are some effects that are just plain easier in Flash. The prime example is of course the pirate map and radar map Justin Everett-Church did soon after Beta launched (Flash 8 required).
Developers have the option of not only using Flex but also our AJAX library. I think people don't recognize that we also have an AJAX version. So even if you're not comfortable with the Flash version, we have an alternative which, from everything I've heard from the developer community, is one of the best API libraries in the market. A lot of Yahoo!'s own properties use the AJAX library like Yahoo! Travel's TripPlanner and our slightly updated Local front page.
As a designer, I appreciate the feeling that the sky is the limit now when it comes to what kinds of interaction we could or should have. Of course that has to be tempered. Just because we can animate a gif doesn't mean we should.
Finally, there's the question of back button/address bar support. How will people send a link or bookmark a set of directions in Flash? The solution we have in place is what I feel to be the most underrated features we have. Every move, every plot, every zoom automatically updates the address bar so when you bookmark or want to send the map, you do what you would with any website - save or copy the address bar. Ironically, we kept getting asked where the permalink button was.
Don't get me wrong, AJAX has created a lot of options for us as designers and Flash isn't something I'd recommend for everything but I think people who dismiss Flash on principle are missing out on a lot. We certainly to run into problems, in particular with performance, but I'd say that so far, it's a pretty nice package.
Having visited with lots of development teams in Silicon Valley, there are lots of teams struggling with larger AJAX projects. AJAX works very well in the small but gets exponentially complex on larger projects. Worse, it forces a development team into a reactive stance, forcing teams to update released software when new browsers arrive.
Ted's AJAX Litmus Test:
Will the AJAX site you are creating today work tomorrow?
Without modification?
Are you 100% sure?
Would you risk your business on it?
For the record, I am not an AJAX fan. I believe it is great for small projects and a minefield for larger projects. In the long run, we will look back at the AJAX revolution and see a titanic waste of time and money. For medium to larger scale applications, AJAX is house of cards.

As an Adobe Technical Evangelist for Flex, I have kept my feelings on AJAX quiet given the new job and employer. My feelings on this are not new as anyone who has worked with me can attest. Sorry if my statement rub you the wrong way, it is just how I feel.
Cheers,
Ted :)

Hi Ted, is there a link to source info?
That first line caught me short: "Why did you go with Flash opposed to the more widely used AJAX?" The only stats I've seen show more use Flash than "Ajax":
http://weblogs.macromedia.com/jd/archives/2006/09/regional_webtec.cfm
"Sorry if my statement rub you the wrong way, it is just how I feel." JavaScript is great... a useful technology. When people say "Ajax", though, they might mean any of several things. Don't let their inaccuracies sway you from the truth, though... the browsers' various scripting engines remain useful.
Ahhhh....
Source got removed, I will add that.
http://unraveled.com/archives/2006/08/design-inside-yahoo-kevin-cheng
RE:
"Ted's AJAX Litmus Test:
Will the AJAX site you are creating today work tomorrow?
Without modification?
Are you 100% sure?
Would you risk your business on it?"
BS! The same can be said for Flash.
I don't use Yahoo Maps because the Flash runtime slows everything down. Google Maps wins hands down.
The only case where I can see Flash having an advantage over DHTML & Ajax techniques are the new vector filter effects new to Flash 9.
This article was clearly written by an miffed x-Flash developer pissed about all the new Ajax hype.
Actually Flash Player is backward compatible and forward compatible with each SWF file format. Every SWF I have ever made still works, the same clearly cannot be said about DHTML and its modern label AJAX.
Biased, me? Maybe.
Ted :)
True, but try retro-fitting your Action Script between different versions. Last time I checked that wasn't a pleasant experience. :).
To the previous anonymous user, I don't agree. I can still run flash projects written for flash 3 in today's runtime!
Also make sure you read my points. I think AJAX is great for small stuff but it becomes exponentially less productive and incompatible for larger projects.
Again:
AJAX == Good for small additions to HTML Sites
AJAX == Bad for medium to large projects
Ted :)
Stacy,
Yes ActionScript development has had major milestones in its evolution. The joy is that the output SWF file is backward and forward compatible.
With the latest AS3 release the language has reached a level of maturity and the API's have been redesigned with web and desktop applications in mind.
Unfortunately with AJAX, applications are deployed as source code and are thus fragile against DOM changes, event changes, JS changes that occur within each browser.
Ted :)
Let's remind ourselves where Ted's opinions are based. Look at his title: "Ted Patrick > Flex Evangelist > Adobe Systems"
XMLHttp has been supported since IE 5 and works fine with upgrades if it was implemented correctly to begin with.
What can be said about the sluggishness of the Flash player? Ajax doesn't have that problem.
-Matt Johnson (previously Anonymous)
I agree with this post 100%, but as a Flash developer I may be biased :)
My biggest issue with yahoo maps beta is that the map images seem to load really slowly, compared to google maps. This is not caused by the Flash player, but rather by the image servers.
For an example of a fast-loading Flash mapping app, check out http://www.flashearth.com/, which loads images from google maps or MS Virtual Earth.
Matt,
Flash Player 5 contained a full XML Parser, HTTP/HTTPS loading of data, XMLSocket.
Suprizingly this player worked in Internet Explorer 3.0 and Netscape 3.0.
Even stranger is the fact that you can install Flash Player 9 in Netscape 3.0 and run Flex 2 applications built today.
The Flash Player provides a component based development platform that bufferes the developer from browser compatiblity.
I bet we could go round and round for weeks like this. Nothing personal here, feel free to email me offlist at tpatrick@adobe.com.
Cheers,
Ted :)
Matt,
In Flash Player 9, Adobe removed all sluggishness from the player with ActionScript 3. Player 9 contains a JIT compiler and emmits native PPC, X86, ARM machine code internally. Code execution now runs at C speed.
Plus the Flex SDK and compiler are now free for anyone to write applications with.
Ted :)
Let me restate:
"Code execution now runs at C speed."
now
"Code execution now runs at native machine speed."
Much better.
ted :)
I have to agree 100% with this. This is the exact reason I moved away from the AJAX platform (which I had used for a couple of years before AJAX was coined, even dating back to remote scripting with a java applet).
Once I found Flex, there was no going back. I think if you were to give Flex 2 a chance Matt, your bias for AJAX might lighten a tad ;) Hell, there might even be a Matt Johnson > Flex Evangelist page one day...
Seriously though, there is a major difference between Flash and Flex development. Have you actually tried Flex 2? The sluggishness is gone, plus you have the AMF3 format which is much faster "over the wire" as well as de-serialization performance (being a binary format) than XMLHttp. Give it a shot. I know Ted has done AJAX, so I don’t think there is an unwarranted bias…
The example on flashearth.com helped clear up my concerns related to speed. After reading the advancements that came with Flash 9, I am now less leary. Thanks everyone for setting me straight :D.
-Matt Johnson
Yeah, Matt, Flash AVM1 (flash 8 and below) is pretty slow. That was one of my biggest complaints about the flash platform. I think AJAX's scaling problems were equal to Flash 8 and belows performance issues. I am extremely happy to see they fixed that with 9. Now Flash 9 should be considered a major player in the enterprise delevopment market. Kudos Adobe!
Hi all,
Interesting article. I would like to say, though, that I don't think the biggest problem is either Flash or AJAX, but how we, as developers, implement. All too often developers who work in AJAX or Flash have come from the front-end of programming design, and not from a solid programming background that would include OOP and UML training. These are invaluable tools for any type of development, no matter if you are working with Flash, AJAX, Java, or C, mainly because it teaches good coding practice, along with the understanding of memory usage. Granted there were latency issues with Flash, and I'm not always impressed with the response time of AJAX, but each has its own merits for the right purpose. Thus, I would like to debunk the notion that AJAX is only feasible on small projects.
I'm currently on a massive project for a giant of a company who runs one of the top 20 most visited sites in the world. Because of the dynamics of what we have to do (e-commerce), we have implemented AJAX as our asynchronous runtime environment. Is it a bear to work with? Not at all, but that's because we took a little bit of time to build a framework. And that little bit of time only cost one developer a single day of development time.
I will say, though, that it is a little more convoluted working with Javascript objects as opposed to an OOP language like Actionscript, but as long as you establish proper coding practices and build it like an OOP project, you should have no problems in size and scope. And I would also like to mention that the site works with Firefox, IE and Safari/Konqueror.
Do not misunderstand me, I am in no way making a case for AJAX over Flash, but I feel that there is too often a battle over which language is better. The truth is, one is not better than the other; they have advantages for the roles for which they are used. I'm a HUGE proponent of Flash and Actionscript, and am always singing its praises. But everything has its place and purpose, and I think that we, as developers, should take the responsibility to discover what is truly the best solution for the job, and not simple the solution that we want to use.
Kudos to Yahoo! and Kevin Cheng for researching their decision, and not simply using the latest buzz-word.
Daniel Konopacki
Daniel,
There is a lot of risk in development of medium to large projects with AJAX. Risk in developer productivity and risk of long term compatibility. It is unfortunate but AJAX is easy to implment at first, but is a devil to maintain compatibily. Companies are signing up for AJAX projects without fully understanding the longer term difficult road ahead.
Frameworks, ugggghhhhhh... Is a framework always the solution? I hear this one over and over and it is false hope. Unless every single developer utilized 100% framework code, the application is fragile. With AJAX development all it take is one developer implementing one incompatible call and the entire app breaks. Worse, you are building large buildings on quicksand of migrating browser standards, stating you used a framework just means that you can blame the framework when things start to break on a live site.
I guess I am just against building medium to large projects on quickstand as a general rule.
Ted :)
If you want to build on a
Ted,
While I agree with you that there are a lot of risks associated with frameworks and AJAX, it's not to say that the framework nor AJAX is the central cause of poor development. The onus lies solely on the developer's understanding of the language. The real problem is the lack of knowledge that most "developers" have in true programming design concepts. The proof of this doesn't even have to be in bad AJAX implementation, but rather in bad Flash implementation.
Many, many, MANY companies who use Flash for their interactive development do not use proper programming practices when they do their sites. I know because I've looked at the code of the ones that look really good. There are so many levels of movieclips, tweens, and frames with Actionscript on them that they, too, become virtually unmanageable once the site launches. Even Adobe's own documentation for Flash best practices says to abstract communication layers with the server to one centralized location - essentially a framework. The reason? Because if the site does break, you have one location to debug instead of an entire data archive of Flash files.
Along those lines, a framework built so that it is so dependent on sub-objects being written in a very specific way or else it breaks is a very poorly written framework. Object oriented programming, what should be the very backbone of a framework, needs to be developed in a Module View Control (MVC) format. In other words, your site is partitioned between it's design, logic, and architecture. Why? Portability, extensibility, and compatibility. Hence the reason that Macromedia came out with Flex, and Adobe has kept it around. And yes, Flex is a framework for Flash development.
In the end, it is neither Flash nor AJAX that is the problem when it comes to the deployment of a project, but rather the lack of understanding on the part of the developer. Flash, by far, is easier to develop than AJAX. The documentation is better, it has a pretty IDE, and it's a bit easier to work with when it comes to browser compatibility. Is it ALWAYS cross browser compatible? Funny enough, the answer is no. Try doing an HTTPS call on a Flash file, or XML file, in IE and watch as your file may or may not load. It will work in Firefox. The reason - because IE handles caching different for HTTPS than Firefox does, and if you have the wrong setting, it won't work.
It is not the lack of the language with which we should concern ourselves, but the encouragement of the developer to actually learn the fundamentals of programming in order to gauge which solution is the appropriate one for the task at hand.
Daniel Konopacki
The HTTPS issue with IE is the lack of a crossdomain.xml file on a certain port. I blogged this about a year ago, it is an IE error but an easy fix.
JS and the Browser DOM will change behavior and will break apps especially medium to large apps. Choosing AJAX means adopting this reactive model of development. It is unproductive and a waste of resources.
In your application I would bet $100 that the app will breka for end users in less than 3 months at the release of IE7 and FireFox 2.0. Again building large buildings on shifting sands is a bad idea regardless of how "Good" your development teams is.
Regards,
ted :)
I have to agree with the points Ted made. After the word became a meme, there was a surge where my freelance clients were asking for Ajax work. I could have dropped what I was doing to learn it so I could ride on the bandwagon, but when I looked closer, I saw all the quirks involved in doing even a simple task in a not-quite-object-oriented language which is slightly different for each browser. So I said “screw it” and focused on Flash instead (and incidentally, I haven’t had any trouble finding Flash work since then).
Hi to all. This is my first comment on this post so have soft point on me. I agree with the daniel point of view that it's not ajax vs flash it's the implementation that matter.
I really feel the same when i was working on my projects.
Even u can work with Ajax applications that are to the level of middle or huge application if you break them into sub modules.
Breaking an application into modules also helps you make faster developement in the long run.
There are various kinds of components available for ajax that helps ur task.
Regarding the compatibility issue why not use a standard library (prototype.js). These guys are masters in their arts and provide u future proof standards.
I am not opposed to flash but i think Ajax helps in many cases. Even database applications can post asynchronous threads to increase the speed and ease the developement. please guide me on this if i am wrong.
The interview misses the point. AJAX is *free*. Flash costs. Flex Enterprise 2 costs more than my car! Which one has a better "return on investment?". If I have a text-heavy data intensive application, seperation of content and display, support for multiple languages, then Flash is a really poor choice. The example given, (Google Maps), is very graphics-heavy, but it isn't vector format, so Flash is just acting as a mini-browser.
I had high hopes for Flash in the very beginning, but the price and support was so poor I gave up and wait for someone else to come up with a better product. AJAX is just starting to fill in the gap that was never completely filled by Flash XML and data access.
For consumer applications like Yahoo! maps, site operators should ask whether or not people can use it.
I have never been able to get Yahoo maps to work on my computer. It says loading and nothing ever happens. That happens even with my flash blocker turned off.
Needless to say, Yahoo has never responded to any of my e-mail requests for help. It is bad as Adobe.
Mapquest.com works fine.
Flash advertising users should also how much money they pay for ads that no one sees because people block flash.
Many web users believe that Flash sucks.
I will say one thing.
1) TRY IT! (Flex 2)
You will be sold after your first night of programming. I have seperated code from display objects and am now sold on Flex. My competitors will have a hard time catching up. Compatibility will be the future killer of ajax apps. I personally do not want to maintain broken code.
Adobe has the same problem as any company trying to stay up with our demands. I love .NET, but I know where it works best.
All my future internet data applications will be on Flex, until there is something better. I doubt it will come.
Tony
I still have Flash 8 installed on my computer and I have found a few sites whose flash videos used to work but when Flash 9 came out, a few months later, the site's flash videos stopped working. I suspect that they used some Flash 9 specific calls. And there isn't even a version detection to say that I am using an outdated Flash version. The flash area is just blank. Is Flash really forward compatible? Also, I've found that the flash-based Yahoo! Messenger requires Flash 9 and doesn't work in Flash 8.
Some of your repeated points don't make much sense at all.
>>JS and the Browser DOM will change behavior and will break apps especially medium to large apps.
Will today's dom calls work in 5 years? I'll bet they do, so nothing will break. Are you leaving your apps untouched for 5 years anyway? No. When you update, you update according to the latest framework, either Flash or Ajax. You then adjust your site code accordingly. No difference.
>>With AJAX development all it take is one developer implementing one incompatible call and the entire app breaks.
A Flash developer can write bad code as easily as an Ajax developer. Each can cause errors. And a js error doesn't bring down an entire app.
Go to a flash app and try to right-click to open an item in a new tab to check it out. Ooops - can't. Have to load it in the same window. Slow, poor user experience quite often. It is rare that I have found a good flash app.
Maybe ajax apps are so much better quite often because they are 1) closer to html norms, and 2) so many people have the skills to build them especially with the excellent frameworks out there today.
ajax = text
flash = graphics
Come on people! Stop comparing apples and oranges. Ajax wins hands down, because I don't care about flashy graphics and worthless widgets that do nothing but clutter the page.
I do feel that, unless standardization of all features across all players happens, there needs to be additional development with respect to capturing and handling user interactions in all browsers.
I must also mention that the lack of ability to play various Media formats, and the lack of a visual IDE for creating things like shapes and basic user interactions without having to delve into code is what really is holding AJAX back.
There is one thing that AJAX does quite a bit better than flash, and that is giving the developer control over the right click. If I didn't have to create hacks in Javascript to get rid of the rightclick context Menu, than I would use it more often for the kiosks I create.
Get rid of the right click context menu BS, and then I will promote Flash myself.