5 Reasons why HTML5 will still be friends with Flash.

3

Posted by Noj | Posted in Uncategorized | Posted on 15-02-2010

Recently we’ve all seen the buzz about HTML5 going to kill flash from mac-fans because their God steve said “Whenever a Mac crashes more often than not it’s because of Flash. No one will be using Flash,  The world is moving to HTML5.”

A bit of background, I spend 8 hours a day working with web front ends both in  javascript/html/css and flash/flex. I tend to use appropriate technologies where necessary. I believe to solve a problem ‘You need to use the right tool for the right job’.  HTML and flash aren’t quite substitutes of each other, both have some subsets overlapping but from a broad view you can see why each technology was created. I am a RIA (rich interactive app) developer and not a flash developer, I use whatever tool that best fits my problem.  Gskinner has a much more awesome blog post about it. Below are 5 reasons why HTML5 will still be friends with Flash

  1. The language Actionscript 3 – is an implementation of an open standard ECMA-262 set by the Ecma Standards Body. It inherits its language ideas from javascript, java and a bit of C++, its not the world’s perfect language, but for web programming it has several advantages of javascript. AS3 is a proper Object Oriented language with Classes, Interfaces with much syntax borrowed from java. It supports typed objects meaning the compiler can add several optimizations at compile time to make it run really fast on the AVM2 Virtual Machine, which is open source. Having typed objects means I can get better errors when something goes wrong.  Javascript on the other hand is just in time compiled (JIT) or interpreted at runtime by the browser. It can’t afford to spend much time optimising the code that a compiler can. If an error in javascript occurs and its because of a type mis-match you generally spend more time debugging what went wrong.On the developer side, the IDE (Flex Builder in my case) would assist me in finding errors, where I may be passing wrong parameters. In addition Code completion would boost the time it takes to develop something. Now some of you would talk about Google Web Toolkit which works on JAVA. I have tried messing around with it, but it still doesn’t beat the speed of creating a quick working app with MXML and Flex Components.
  2. API – When it comes to allowing developers access to creativity, flash has its edge. Some recent camera experiments at work. Doing all the maths but still having decent framerates. Its quite amazing how much of some web features are run by invisible flash movies, because some functionality is impossible to acheive somewhat or not at all on major browsers. e.g Copy Text to Clipboard, Multi-file upload (Gmail uses invisible movie clips to do this), TCP sockets, C compiled libraries on alchemy, Parrallel bitmap manipulation with Pixel Bender, Playing Mp3 sounds on background (yep that’s how you get Google chat/facebook chat pop sounds, Yahoo media player, e.t.c to work). Advanced Text Control. Now again HTML5 has tags, or proposed tags for most of above to work, however getting them to work alike in most browsers is still a massive task. Flash will keep innovating, e.g Peer-to-peer networking with RTMFP, HTML5 has no equivalent of this, may be GPU support and full openGL integration in future. To my knowledge there is O3D and other plugins but HTML5 has no proposal for any such javascript API.
  3. Market Penetration - Flash takes about a year to reach about 98% penetration while HTML, errrrmm,  IE6 which is a 10 year old browser, still has a descent slice of the browser market share. In a nut-shell this means for flash to innovate and add new functionality it takes much lesser time than HTML5 to propagate amongst the crowd of browser. When is flash going to be ready ? The year 2022. Still a long long time for flash to play in the playground. Looks like we’ll have to wait for HTML5 (final specs) to run the browsers in iMars spaceships.
  4. Same Code, Multiple Runtimes - Getting something to work alike, along multiple operating systems, is not a simple challenge. It makes a great deal of sense in terms of cost and time it takes to deploy something in flash/air. A good number of our clients ask us if they can deploy the same code to work as a desktop app as well. With simple code changes you can bundle the same app that runs on the web and make it run on the desktop with adobe air. New flash 10.1 will make the same code also run on mobile phones. As a content producer it gives me a chance to reach a mass of users, not worrying about what OS or Browser religion they are following. I do agree that even flash 10.1 still doesn’t have great performance compared to native code, and adobe needs to work hard on the mobile so that apps can have the same usable experience as iPhone apps. No one like apps that hog memory and battery. I would suggest adobe to take actionscript to the next generation (more low level control) and add more compiler optimsations. If google chrome’s V8 engine is that fast with javascript, I seriously think actionscript can gain huge performance benefits. Talking about HTML5, I would say adobe has the greatest power to bring mass market penetration. If you remember a while ago, there is was an ie-chrome plugin, which puts chrome’s html engine into internet explorer. Adobe already has webkit in its air runtime, It shouldn’t be so hard for them to bundle a HTML5 engine right into flash. So if a browser doesn’t support HTML5 you can fall back and use flash as the renderer.
  5. Creativity & Interactivity – Although google has worked really hard to create the fast javascript runtime with Google Chrome’s V8 engine. The amount of time it takes to create an interactive app in javascript is almost double, I did some physics simulations in flash, doing them in javascript took almost 5 times longer. I just feel the canvas API is hectic to work with compared to the bitmap API. Having great IDEs such as Flash IDE, and Flash Builder get you as a developer some real work done. Aptana studio and Eclipse WRT are good, but still don’t offer the same level of code completion and other smarts. I would agree frameworks like jquery really making adding intereaction to pages quite easy. But looking at how flex solves the transitions, states, skinning, data binding, Its miles ahead of HTML5. This is going to become heaps better with Flex 4.  FXG >> SVG.

On the bottom line I would say, We can never exactly say if adobe decides to open source the flash player. Just as flex sdk went open source. Adobe doesn’t make much profits on flash player, they make $$$$ on tools e.g Dreamweaver, Flash IDE e.t.c It would be good to see flash sort of become a web standard. I understand they can’t open-source the video and audio codecs built into the player, but they should start slowly opening up flash internals where they can, so the community can kick in and help out. Adobe is definitely more open than macromedia, they opened up flash 10 bytecode specs, open sourced avm2, flex sdk, the as3 compiler, removed fees on flash player distribution. In terms of openness google >> adobe >> apple.(my view)

That rounds up my 3rd blog post. Let me know your views, I could be biased, not have the correct facts or info, be too optimistic, however I would be interested in hearing your thoughts. (please don’t mind my grammar, English is not my first language)

Comments (3)

Hmmm.. why is everyone commenting on this post through Google buzz!.. hello!… u can leave comments

Why doesn’t Adobe build a feature for compiling flash into an html5 canvas element with javascript?

Adobe already has this functionality in flash CS5,

but the problem is canvas element anatomy and the flash engine anatomy is very different.

in flash there are sprites, display objects, movie clips, shapes. Javascript has DOM API, where things have to get added to a tree, and the view gets updated from the model.

Because flash giving a more lower , easier and efficient access to graphics it makes flash a platform much tastier for interactive developers and designers.

there are numerous examples on the net about javascript versions of flash, however they run quite slow.

Write a comment