HTML5 vs. Flash: The case for Flash

Seven reasons Web designers will remain loyal to Flash for rich Web content

Page 2 of 5

Reason No. 1: Flash's sub-pixel resolution and anti-aliasing
Do you want a border around a block of text rendered by HTML and CSS? Well, you can choose between 1 pixel, 2 pixels, or n pixels. The spec does allow floating point numbers, but the numbers between the integers tend to be ignored or rounded off in a slightly different way by different browsers.

Flash not only accepts floating point numbers, but uses the same rules to draw lines, boxes, and images on all machines. Using sophisticated anti-aliasing and blending algorithms to render lines, Flash gives the illusion that screens have more precision than they really do. The eye can tell the difference, and that's why Flash sites look better.

This is gradually changing as browsers begin to support the Scalable Vector Graphics (SVG) standard and allow JavaScript programmers to mix it with Canvas objects. But while SVG is impressive, it's still a long way from efficient, thanks to all of the extra characters the XML standard insists upon. Compression can help, but there's still something funny about the SVG-Whiz suggestion that the artists should "keep an eye on the generated code, and trim it down by hand where possible."

Reason No. 2: Flash beats Canvas
A good way to get a feeling for the new Canvas object in HTML5 is to play a few rounds of FreeCiv, a free, open source version of the classic game Civilization. The developers implemented all of the basic graphics routines using the HTML5 Canvas, and they all work fairly well. Anyone who assumes that JavaScript's main purpose in life is to check registration forms in Web pages will be very impressed.

But anyone who compares the results to the better games based on Flash, Shockwave, or AIR will just be mildly amused. Many of the Canvas products are impressive, but sometimes the code just doesn't work or pokes along. Some browsers are fast and some are slow. Some operations are quick on one browser and sluggish on another.

To make matters more complicated, not every browser implements every feature in exactly the same way, a problem that shouldn't be surprising to JavaScript developers. There are good efforts to simplify this with intermediate libraries like Processing.js, but even these can't handle every combination.

Flash isn't immune to the complexity brought to us by the proliferation of operating systems and browsers, but it has been dealing with them for much longer. When the Flash plug-in doesn't crash, the results are slicker, smoother, and more consistent.

But there are signs HTML5 will get there. For example, Smokescreen, which renders native Flash on Canvas objects, doesn't yet run on IE or Opera but is very impressive on other browsers.

Related:
| 1 2 3 4 5 Page 2
From CIO: 8 Free Online Courses to Grow Your Tech Skills
Notice to our Readers
We're now using social media to take your comments and feedback. Learn more about this here.