Friday, July 29, 2011

FLEX vs HTML5... The showdown.

I've been asked this question more than a few times lately, so I've decided to write some notes comparing between the two platforms.
I am currently leaving out other competing environments like gwt (not good enough), silverlight (why would you?) and javafx (not nearly there).
But first off - Before comparing between the platforms, you should be focused on your needs and target devices:
Does your application require heavy graphics processing? Animations?
Is it supposed to run over smartphones and tablet devices? Netbooks? Power desktops?
Are you able to deploy your application to app stores? Do you have the budget to target several platforms?
What are your performance goals?
Perform that analysis, and you will be able to compare between the two, and find the platform that suites your needs.

So, without further delay, let's begin:

Ease of development:
Advantage flex. Though html is very easy to learn, deploy and even debug, flex can be faster, especially with form based apps. flex has a nice WYSIWYG editor, with fast link to simple code. flex also has great built in graphs and charts, to which data could be easily linked. html is gaining ground, though, with new and better development environments in the pipeline.

Performance:
Advantage html. html is 'native' to browsers, while flex runs inside a browser, over a virtual machine. flex has several garbage collection problems (To which you need to go deeper into actionscript studying), is very cpu and memory greedy, and even takes more time to initialize and load.
If you need to run over tablets and netbooks, html should be the way.
If you do go with flex, consider this: Internet Explorer 8 and up has the best flash performance (According to several benchmarks I've performed). Chrome and firefox are slower, and android web browser is even slower then that.


Deployment:
Advantage html. This one is easy. flash needs a plugin. flash doesn't work over iOS. Flash builder 4.5 is supposed to have an iOS 'workaround' - running flex apps over iOS air runtime environment. IE10 is supposed to be closer to webkit browsers that to IE9, which will bring less browser compatibility issues.

Richness and graphics:
Advantage flex. Though html5 and css3 bring canvas, svg, effects and some other great stuff, flex and flash are still better. html is gaining ground here, though - there are lots of neat canvas javascript libraries out there.


Interop:
Advantage html. Need to open an office document via your app? A java applet? Can't do that on flex.

Documentation and development environments:
For flash builder, you will need a license. Knowledge base is quite large, but not nearly as large as html. To develop html, all you need is a notepad and a web browser.

To summarize:
In my opinion, html is the way to go. Faster, better performance in most cases, cheaper development and setup. Runs over every device, and besides - Everybody wants to develop better and faster browsers, rather than faster flash players...
So on the overall, for now, html wins by points.
But as the time goes by, html is getting better and better. So unless you're doing something that requires the flash platform or requires flash graphics, go with html.

No comments:

Post a Comment