Flash vs Javascript

I know what you're thinking. There's a gazillion blog posts on the web arguing about Flash and Javascript. So why write another one?

This one is slightly different. I work in a commercial, competitive environment where there is strong opinion both sides of the aisle. And a mix of clients (doing good work) actively seeking to use both technologies. And strangely enough, a sort of consensus is starting to form. So I'm going to try and capture that consensus and share it here. No doubt colleagues past and present will put me right!

The consensus is that we're going to use open web standards (html, css and javascript) wherever possible and practical, for the following reasons:
  • Easy to optimise for accessibility
  • Easy to link to specific content (each page has it's own URL)
  • Easy to copy particular text for pasting elsewhere
  • Easy to optimise for search engines
  • Easy to subsequently change and maintain code
  • Works on all devices, all browsers (unlike, say, Flash on an iPhone or Wii)
  • No need to download plugin or application
  • No dependance on an external vendor
  • Ability to view source (supporting the education of development communities)
Html, css and javascript are the building blocks of the web, and we want to contribute to the ongoing improvement of the web wherever we can. Some of the above is possible when using Flash, but rarely used (especially where budgets and resources are limited) and difficult to implement.

BUT! The challenge comes when we want to do something that isn't practical or possible using open web standards.

I think it's OK to use Flash when:
  • We're streaming videos or music. This is the only way to get this stuff out to a wide audience (at the moment)
  • We're creating complex, interactive, immersive (maybe 3D) environments. These could include animations. To some extent, this is possible using web standards, but only with a greatly increased build time. This is the key: persuading someone to pay for this is a different prospect to a lone developer dabbling with the technology in his or her own time. Depends on how much more expensive it is, of course - but we've got to be practical. If we go down this route, we MUST still make the information accessibility compliant, linkable and available for search engines to spider.
  • We want to create effects that can't be created using open web standards. In this instance, it's still essential that the experience degrades gracefully. We're talking about design-led flourishes that enhance the mood of the page - but leave the content untouched. If someone visits the page who hasn't got flash installed, they'll be none the wiser - the same information will be accessible in the same way. Our home page is a good example - for those who have Flash installed, the characters at the bottom move around. For those who don't, they're static hyperlinks. There's something to be said for beauty on the web, and sometimes that beauty will be animated.
The open web standards crowd (including many friends) may gag on these points. But I think the above is a practical compromise. It is inclusive and recognises the fact that cutting edge front end development is time consuming. If something takes much longer to design and build using web standards, then we'll be pushing work away if we don't compromise. We work in a highly competitive industry, and it's easy to be idealistic when you don't have to worry about commercial considerations.

All that said, we actively seek opportunities to innovate using javascript libraries and emerging technologies - within those commercial limitations.

In a large team, working with a complex client, there may also be political issues at play. Does the client have the expertise to maintain complex code? Are the people crafting the user experience sufficiently skilled to understand what javascript can offer? In the real world, these are all factors that will will inform the decision.

What about when clients ask us to build something in Flash? We will inform them of the risks. We won't turn down work if they insist on using Flash - the alternative is that they'll go elsewhere, and we won't be able to work on converting them! And, yes, if we do the work, we'll get paid. Without our customers, we'll go out of business.

I'd love to hear views on this, particularly where there are other situations where one would make an argument for using Flash. Further arguments in favour of open web standards are also welcome - but do bare in mind those commercial considerations!

Comments

jayfresh said…
Good post Phil.

I don't think one needs to pander to fundamentalist web standards people who won't admit Flash into their lives. Flash does some things well and/or faster than open standards-based tools, as you've clearly explained above.

As an Osmosoft alum and a practicing web designer keenly in favour of standards-based stuff, I have no problem including Flash, appropriately.


J.
Jim Lundblad said…
There is an English idiom "Horses for courses"

When it comes to accessibility in Flash you have a larger variety than normal HTML (most cases, all you need is to tick the box in flash saying Accessible), and all the code is there for anyone who wants it unless the flash producer has been explicit in protecting his code, which is anyone's right if that is what puts his bread on the table.

And also when it comes to compiled languages, most things are quicker. And then the issue with cross-browsers compatibility.
Phil Whitehouse said…
Jim > not sure I understand your point...my post is about which horses are suitable for which courses - I've tried to define when Flash is appropriate and when it isn't. Do you have a view?
philhawksworth said…
Jim,

'There is an English idiom "Horses for courses"'

Indeed. And I think that this post acknowledges that. I totally agree that there are times when Flash is exactly the correct choice. There are also times when it's not.

I'd be interested to learn more about the "check box" which makes Flash accessible. By coincidence, I also blogged on this topic yesterday. I had heard people mention that Flash could easily be made accessible and would love to see some examples of this. I'd invite you to cite some examples in the comments section of my post. I think that would really help the conversation.

One thing worries my though: If there is a simple option to make Flash accessible, why would anyone not? It's possible that I'm misunderstanding. Can you offer more info?
Mr D said…
I generally agree. Open Source and JavaScript lags behind what people have come to expect on a website. It has taken years for JavaScript libraries to start to catch up with what Flash has been offering for years.

When JavaScript (or what ever other standard is created that it built into all browsers - as you never know what the future holds) can do everything Flash can do, then Flash will become redundant.

I think we are a few years away from this.

Accessibility is less of an argument against Flash as time goes by, Adobe improve the software, and screen readers are finally updated – don’t get me started on screen reader technology lagging. Now THAT would be an amazing OpenSource and worth while project to help. NVDA is making in-roads but it still doesn’t support Flash – perhaps it’s up to Adobe to work with an organisation like this.


Easy to optimise for accessibility – Flash is still not that easy

Easy to link to specific content (each page has it's own URL) – this is simple to do with Flash

Easy to copy particular text for pasting elsewhere – again, not difficult to implement

Easy to optimise for search engines – true. Lots of noise a while ago about Flash being indexed by Google. It’s not great still as it indexes the actionscript code, and not the content alone.

Easy to subsequently change and maintain code – so is Flash. Flash actionscript is Javascript based.

Works on all devices, all browsers (unlike, say, Flash on an iPhone or Wii) – New devices may not support Flash immediately, but they will. I believe it could become a standard for mobile devices. Flash does run on a Wii (only 7) as Adobe haven’t released SDK’s to allow this – not clever and why open source could start to kill their products over time. Flash isn’t on the iPhone as Apple can’t make money easily. It could kill off their widgets money machine over-night.

No need to download plug-in or application – True, and annoying.

No dependence on an external vendor – True, but there are two sides to this coin.

Ability to view source (supporting the education of development communities) – however Adobe are making moves in the right direction with Open Source.


To summarise: Use Flash only when you can’t do what you want with HTML and JavaScript. Please don’t start with ‘we need a Flash site’ which still happens. I think the most powerful designers are also the most technology savvy. Not as common as I may hope.
Mr D said…
I generally agree. Open Source and JavaScript lags behind what people have come to expect on a website. It has taken years for JavaScript libraries to start to catch up with what Flash has been offering for years.

When JavaScript (or what ever other standard is created that it built into all browsers - as you never know what the future holds) can do everything Flash can do, then Flash will become redundant.

I think we are a few years away from this.

Accessibility is less of an argument against Flash as time goes by, Adobe improve the software, and screen readers are finally updated – don’t get me started on screen reader technology lagging. Now THAT would be an amazing OpenSource and worth while project to help. NVDA is making in-roads but it still doesn’t support Flash – perhaps it’s up to Adobe to work with an organisation like this.


Easy to optimise for accessibility – Flash is still not that easy

Easy to link to specific content (each page has it's own URL) – this is simple to do with Flash

Easy to copy particular text for pasting elsewhere – again, not difficult to implement

Easy to optimise for search engines – true. Lots of noise a while ago about Flash being indexed by Google. It’s not great still as it indexes the actionscript code, and not the content alone.

Easy to subsequently change and maintain code – so is Flash. Flash actionscript is Javascript based.

Works on all devices, all browsers (unlike, say, Flash on an iPhone or Wii) – New devices may not support Flash immediately, but they will. I believe it could become a standard for mobile devices. Flash does run on a Wii (only 7) as Adobe haven’t released SDK’s to allow this – not clever and why open source could start to kill their products over time. Flash isn’t on the iPhone as Apple can’t make money easily. It could kill off their widgets money machine over-night.

No need to download plug-in or application – True, and annoying.

No dependence on an external vendor – True, but there are two sides to this coin.

Ability to view source (supporting the education of development communities) – however Adobe are making moves in the right direction with Open Source.


To summarise: Use Flash only when you can’t do what you want with HTML and JavaScript. Please don’t start with ‘we need a Flash site’ which still happens. I think the most powerful designers are also the most technology savvy. Not as common as I may hope.
I must add that an important factor also is the objective of the project to be able to choose between one or the other technology