Ask HN: Why not Flex?
I'll never get back those weeks of my life that I've spent trying to fix cross browser HTML/CSS/JavaScript issues.
I feel like I have to jump through several hoops just to achieve good-looking rounded corners, especially if the element has a border.
Many relatively standard GUI widgets just don't exist in the web stack (e.g. tabs have to be expressed as an unordered list with an extra element in each to do the "sliding doors" effect).
The set of available fonts is still, in 2009, incredibly limited.
My current project (http://shoptalkapp.com) has typified all of the above pain, and more. It's heavily AJAXy, which only exacerbates the problem.
So I ask the HNers, "Why not Flex?"
81 comments
[ 2.6 ms ] story [ 142 ms ] threadAs far as I know, the answer to these questions is no for Flash based sites:
1) Can it be indexed by most search engines?
2) Is the text always selectable, & copy and paste-able?
3) Does the structure of the Flash movie imply anything about the information it presents? (e.g. <table> elements imply tabular data.)
4) Is Flash & Flex an open platform which can be developed on for free?
Your argument against HTML doesn't point out any weakness in HTML itself. It does point out the lack of a standard and accepted HTML UI library, as well as a simplified, cross-browser compatible development environment for that UI library (the notable exception here may be cappuccino.org and some other, larger dev environments like WebObjects, neither of which I've used extensively).
1) Google can index it. I wasn't aware of other search engines that are relevant. I'm willing to concede that you -should- do extra work to make sure you are search engine friendly, but that doesn't rule Flash out completely.
2) Yes, text is copy/pastable. No, the experience isn't nearly as good. Yes, it's a really big deal that copy/paste sucks for Flash.
3) No, Flash markup isn't semantic because Flash markup isn't public. Then again, how much information does <DIV> imply?
4) Yes. Flex is open source and can be developed for free (http://www.adobe.com/products/flex/). I do all my Flex development with simply mxmlc and fdb, I don't use Flex Builder at all.
http://code.google.com/webtoolkit/doc/1.6/FAQ_Server.html#Ho...?
With that being said, every development environment will have its warts. If you're sick of HTML/CSS/JS, nothing is stopping you from using whatever you want. Look at the QuakeLive guys, for example.
http://hasseg.org/blog/?p=194
Flex code runs inside a sandbox element, much like Java applets. It doesn't feel native to the browser - the Flex app can change things only within its own little canvas. (Okay, there's ExternalInterface as well, but then you're back to writing JavaScript and DOM manipulations.) It's not aware of browser resizing - you're locked into a fixed width layout. It can easily result in horizontal scrolling if you have a full-width Flex app in a small browser window. It generally doesn't show up on mobile devices. It takes forever to load. It disables UI conventions - like being able to right-click on the page - that users are used to. Hitting Ctrl-T when a Flash app has focus does not open a new tab. It's not easily indexable by search engines.
I look at it as Flex:Javascript::Swing:native GUIs. It makes development easier, but at the cost of never quite meshing right with the rest of the platform. You may like it, but your users probably won't.
You can also handle right click/context menus.
Normally the thought of whether something is running in a sandbox is not a concern if I'm using any of these sites. The only times I would get annoyed by load speed issues had nothing to do with the SWF format, it would usually be of the magnitude of the whole site being overloaded.
I could say Meebo doesn't feel native to the browser either, but I think we're way too much into the opinion territory to be saying that, generically speaking, x or y technology is hostile to all users (especially without knowing what the app is to begin with).
It doesn't feel native to the browser
Most advanced javascript apps don't feel particular native to the browser either because HTML still lacks basic widgets like a combobox or -button. How many native browser buttons do you see in your Gmail or Google reader interface?
It's not aware of browser resizing - you're locked into a fixed width layout
Wrong. Flex handles browser resizing out of the box, see for example http://www.grooveshark.com
Moreover the Flex layout manager is heads and shoulders above the box model madness of HTML/CSS.
It generally doesn't show up on mobile devices.
That's one valid point. But then again, how many AJAX apps can you name that are really useful on (which?) mobile devices without a special mobile version?
It takes forever to load.
Nonsense. http://omgpop.com feels quite zippy, no?
It disables UI conventions - like being able to right-click on the page - that users are used to.
Point taken. It replaces the browser context menu with a customizable flash menu. That sucks but it's hard to imagine how it could be done otherwise.
Hitting Ctrl-T when a Flash app has focus does not open a new tab.
Works fine here (OSX/Firefox).
It's not easily indexable by search engines.
Neither is AJAX content.
You may like it, but your users probably won't.
That depends very much on the application. Right tool for the job.
At my job we hold focus groups for all of our projects. Never once has a layman not liked one of our projects because it uses flash.
Most flash hate comes from developers who favor other platforms. Mac vs Windows all over again...
You typically wouldn't load your entire layout via Ajax.
Depends on the application. Flex doesn't compete with your average listing-based HTML webapp. It's competing with GWT and Ext in the field of complex, desktop-like GUIs ("RIA").
(1) do you care about mobile browsers? if not, flex works on 99% of desktop browsers, and looks almost exactly the same on all platforms with no additional code.
(2) do you need real, bidirectional, binary-friendly sockets or is long-polling with json/xml parsing sufficient?
(3) do you need to make extensive use of tables, images with flowing text, and other complex forms text layout that are trivial to do in html but difficult to do in flex?
(4) do you plan on creating a lot of sound / video / vector animations that need to perform reliably and consistently across browsers and platforms?
(5) does your application need to do a lot of client-side processing?
(6) can you combine the two approaches? example: gmail uses flash just to play the "ding" sound in chat or to show the file upload progress bar; video sites mostly use flash only for the video element and do the rest of the layout in html/js; etc.
Here's an interesting one: compare the rendering speed of maps.yahoo.com (flex) versus maps.google.com (javascript). And the fact that on the smartest mobile devices -- iphone, G1, blackberry -- they all have native versions of the maps app, because the javascript on maps.google.com is so intensive that it's an incredibly poor experience in any mobile browser.
Full disclosure: I work on voxli.com, where the UI of the chat room is 100% flash, but the rest of the website (registration, login, intro, etc) are in html/javascript.
2. The flash plugin sucks on most browsers, its a slow unreactive user experience, compare a few full flash sites to their equivalent in javascript.
3. Flex's layout constructs are similiar to pretty much every widget manager around, are in no way close to the power of xhtml/css, I for one didnt find it enjoyable at all to develop for.
how long have you been doing html/css? its a pain that goes away quite quickly, if it hasnt, I would ask some more experienced developers to look over your stuff and see if anythings being done wrong.
and you might want to look at graceful degredation, if ie isnt a particularly large chunk of visitors, your exact problems are very easily solved in a way that very gracefully degrades (-moz-border-radius:, font-face:)
2 - Depends on what you're doing. Animations definitely run smoother and with less resources in Flash than they do in HTML/CSS.
3 - A lot of Flex's layout capabilites "just work" out of the box. You don't have to figure out the complexities of the box model and you don't have to know the intricacies of floats. You just say "I want a container that positions things horizontally and I want them to be aligned on the top of the box" and it does it.
Flex's components I have found are incredibly hard to precisely skin. Then again, so is HTML if you don't have experience in it.
Flash player is not so popular because it doesn't perform well. It perform great. One of the best sources to deliver video and complex interactivity such as games available.
People always attribute the low barrier to entry of flash (7you can crank out a bad website or animation quickly) to the speed and quality of the flashplayer or actionscript/mxml. Honestly, there are many more bad html/css and java sites than flash.
To make a long rant short, quality flash/flex can provide just as good (and oftentimes better) UX than anything else.
And you can have SEO in Flex easily. Check it out: http://www.google.com/search?q=listen+to+free+music+online
also, why is there no reply link under your comment?
See http://www.paulgraham.com/disagree.html
Step two: Complain of victimization.
Step three: Profit?
You can use it for web, widgets, iPhone/Android Apps. It's free, has a low barrier to entry, is easy to update, and has extensive documentation, both free and commercial.
I'm not saying that Flex doesn't have it merits, but as a long time web/flash developer, I'm finding myself using Flash/Flex type stuff less and less (Thank You, JQuery!)
Secondly, the reason webby people don't like it is that they can't scrape it, tie it in seamlessly, etc. The reason it may be a good idea for your business is that it is 1000x easier to whip out a consistent, good flex website then the equivalent in cross browser complaint javascript/jquery/whatever
Oh wait, you can't.
Seriously, they're not the same thing. Flex is a toolkit that compiles to swf but its not flash.
Flash, as something you hire developers for, is an authoring environment. As of CS3, it is not very compatable with Flex.
CS4 actually as adobe tying them together a lot better, but I've yet to put enough time in on CS4 projects to know one way or the other how well they have.
While you may think of flash as "that which runs on a flash player", a vast majority of people developing software in this arena think of it as "that which is written with the component of Adobe Creative Suite 3/4 called Flash Builder"
In this case Flex might be the right solution for you. Heavy back and forth, it dosn't really need to be indexed by browsers.
You likely want some sort of combo with Flex and HTML.
The border issue is kind of a non-starter and not really relevant for a broader discussion (BTW I just use the new CSS rules and let new browsers have rounded edges and the rest get squared - easy enough)
Shoptalk looks great btw. You'll probably want to allow multi-selecting users - dragging them one by one can get tedious.
Also, everything else people have said. It uses a plugin, which slows things down and appears non-native. It's proprietary; if one day Adobe says "Flash Player is universal, let's start charging for it, and jack the IDE cost up 50%. We don't care if everyone moves off of it because we'll make a lot more money off of the relatively short-lived mass influx of license money", or "Let's just not release the new version or ensure compatibility on (Windows 7/OS X 10.6/Linux/Solaris/any other platform important to your userbase) [yet]", or "Let's break compatibility in Flash Player 11 and make a really difficult downgrade path", you and your users are kind of screwed, and so on.
I'm sort of wary learning to code iPhone programs as well -- it seems cool, and there's lots of interesting ideas there -- but do I really want my hard-earned development skills to be dependent on the whims of Steve Jobs?
I've done it, and it does work. Is it a pain? Of course it is. Do you get the Adobe built data components you get with the advanced and charting editions? Nope. Can you build them yourself? Of course, and there's a bunch of open source controls & components you can download too.
You really have to be careful whilst criticizing a company who essentially gave away their protocol and build tools. They could just as easily have marked that IDE and tookit up to $1,000 and we'd still buy it.
One of my co-founders like flex and have programmed some admins in flex, in xml. Myself I don't care much for flash. I've dome some actionscript programming and presentation development but I only do it if I really have to. I much prefer to work with HTML/Javascript. My co-founder would like us to work with flex instead of rails which he dislikes. I have no love for programming in XML, so the middle ground is that we have coded up some small web frameworks in java with seaside-style html generation. It works fairly well.
You can definitely use Rails with Flex. Flex is not a server side language or framework. It can interface with all of them really well through web services. Heck, I'm pretty sure Flex can even inject and call JavaScript functions on your pages. Rails can render things to XML amazingly well, and you can still build an HTML response as well while maintaining the functionality of the Flex application.
Your co-founder is comparing apples to oranges, but whatever works for you all is great. Just don't let the tools limit you.
Flash reconciles various needs, from indy creatives to high-budget publishers to ordinary consumers to videographers to anyone seeking a means to communicate their beyond-text ideas to an audience.
Reconciliation of all these interests is a difficult task. If Adobe were to mess over any of these constituencies, Adobe would pay the price.
Who paid the price for HTML4's confusion over OBJECT and EMBED tags? The responsibility was not as direct.
Flex's default widgets and classes are all easy to extend and customize. You never need patches of js to customize some component on the bottom of the page.
Adding features like drag and drop, navigation trees and tabs are almost too easy. Dividing your app up into loadable(and cacheable) modules can keep your application fairly lightweight, althrough still much bigger than a standard AJAX app.
We(developers) will always be able to feel it when we're using a Flash app(before we even right click), but the CSS/Style/Skin support is good enough to make the app look inviting.
When you do this is flash, it is an application running in your browser. It is far from seemless, and is the equivalent of a java app. It is something that takes time to load, and when it finally does, it takes time for the user to get used to the new experience.
The simple question is, when you come to a page that uses flex do you notice that flash is running. If so then why? Why isn't it completely transparent to the user? Why does it seem like an isolated little object on the page that has little interaction with what is going on around it.
Perhaps I just don't like a company owning any type of represention on the web.
Perhaps you knew all these answers though, and this whole post is a light form of flame bait. In which case I fell right into it by explaining the obvious down sides of flex.
So the positives: *Things move around and look pretty.
As for the original topic, I feel your pain over losing a chunk of life "to fix cross browser HTML/CSS/JavaScript issues". But I appreciate your raising the flex issue; the ensuing discussion has convinced this noob that he neeeds to study up on and experiment with it.
We have started to see the same sort of thing in HTML/JS land (Sproutcore/Cappuccino) but honestly, they come with almost all the same tradeoffs as Flash does.
I would say the File upload/download, animations, skinnable components, layout management, and more in an single well thought out package outweighs anything in the HTML/JS land currently. Sure if you want to patch together components you can get all of the same things, but that's like arguing insert flavor of linux is as fun to use as Mac OS X because it has all the same features.
I choose Flex for the same reasons I choose Rails. It's not a chore to develop in.
(that's not rhetorical; if anyone knows of one, I'd like to know)
(I think Apple may have finally added an API which browser plugins can access for their text-to-speech, but I'm not sure how many people have moved over there yet.)