
Ask HN: Why not Flex? - mrshoe
I'll never get back those weeks of my life that I've spent trying to fix cross browser HTML/CSS/JavaScript issues.<p>I feel like I have to jump through several hoops just to achieve good-looking rounded corners, especially if the element has a border.<p>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).<p>The set of available fonts is still, in 2009, incredibly limited.<p>My current project (http://shoptalkapp.com) has typified all of the above pain, and more. It's heavily AJAXy, which only exacerbates the problem.<p>So I ask the HNers, "Why not Flex?"
======
nostrademons
It's user-hostile.

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.

~~~
moe
I'm sorry but most of that is FUD.

 _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.

~~~
coderdude
>>>>It's not easily indexable by search engines. >>Neither is AJAX content.

You typically wouldn't load your entire layout via Ajax.

~~~
moe
_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").

------
daleharvey
1\. There are a million small disadvantages to using proprietary plugins, it
is not "the internet", google can read flash, but not well, you dont have
firebug, your site cannot be scraped, these may not all affect you, but there
are lots lots more.

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:)

~~~
teej
1 - This is a completely valid point. There are tradeoffs in build a site in
Flash. You have to put extra work into being crawler friendly - something you
get out of the box with HTML/CSS.

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.

~~~
sunkencity
re 2 - I disagree. On a powerful computer flash is OK, but on let's say a Core
2 duo 32 bit and an intel i950 graphics chip, almost any flash will take one
of the cores to 100%...

~~~
teej
And the Javascript equivalent wont?

------
n8agrin
Flash has its place, for sure but it has many short comings when developing an
entire web-based app.

As 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).

~~~
teej
Let's drop the absolutes, shall we?

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.

~~~
allenbrunson
the last time i looked at this issue, writing flash applets with mxmlc meant
that you can't use flash GUI controls. is that still true?

~~~
teej
This is true, you don't have direct access to flash GUI controls from vanilla
Flex. That being said, I have found it rare that I find a Flash control that
hasn't been ported to Flex.

------
dimarco
We're using Flex + ZendAMF(PHP) and development is enjoyable. Serializing PHP
data types that are also native to Actionscript remove the need to parse JSON
and XML. On the wire the data is binary, thus small(no XML tag tax) and fast.

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.

------
camwest
We're using the upcoming Flex 4 for a new project and I'd compare Flex to GWT
but not something like jQuery. It definitely has its trade-offs and benefits.
The state management and skinning system is first class and there are some
great micro-application architectures being created in the Flex world.

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.

------
RobKohr
Ajax is easy to use, and the dom is easy to manipulate using jquery. When yo
create a site with plain html, it fits in perfectly with how the user expects
the web to work.

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.

------
cookiecaper
I have a client using Flex right now. They're having a desperately hard time
finding anyone adequately qualified to perform the work, so availability of
hackers is an important consideration.

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.

~~~
sunkencity
It is pretty sound to be sceptical of any open-source offering from a company
like Adobe. I'd much rather spend time learning some skills in an open source
project where the full stack is open-sourced future proof.

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?

~~~
abyssknight
Hearing this, I thought I'd jump in. The stack is open-sourced. The Flex SDK
and BlazeDS (if I remember correctly) are both open-sourced, as well as the
AMF specifications. There is absolutely no reason why you could not write AS3
code and MXML against the Flex libraries and build your own Flex application
without Flex Builder (the IDE, which costs a paltry $199-$299 last time I
checked).

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.

~~~
sunkencity
The stack is not open source -- the player is a blob.

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.

~~~
abyssknight
I'll agree, Flash Player is not OSS (though projects to emulate this do
exist), and it can be a royal pain but...

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.

~~~
sunkencity
I like flash/flex when it's used as part of a site, to display video, a game,
or some presentation. There are too many benefits from using standard HTML as
to not use it for the main plumbing of a site.

------
lhorie
What put me off was that mxlmc was really slow (10-seconds-to-compile-a-hello-
world kind of slow). Also, I find that debugging HTML/CSS/JS stack is really
easy with Firebug et al, whereas debugging swf's isn't quite a walk in the
park.

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.

~~~
Erwin
Don't invoke mxmlc every time -- that has to start up Java, and that's what's
slow. There's a compile "shell" named fcsh that comes with the Flex toolkit
that starts up a JVM once and lets you recompile without having to relload all
the libraries.

~~~
hasseg
Fcsh is indeed a lot faster than mxmlc. I've written a small shell script that
stands in for fcsh and provides an interface like the standard mxml compiler
(mxmlc) so that you can just call it (like you would call mxmlc) and have it
return an exit status instead of dropping you into an interactive shell like
fcsh does. It's called fcshctl:

<http://hasseg.org/blog/?p=194>

------
eldenbishop
The "cross-browser" compatibility is greatly exaggerated by adobe and "widget"
programmers who don't have to do heavy application programming. I have been
working with a large team for two years on a website with heavy flex
integration and we have had far more browser incompatibility problems with the
Flex than the HTML/Javascript portions. Rendering is very consistent across
browsers but the network stack is largely handed off to the browser which
introduces all kinds of problems. Also, things like transparency and
background mode can massively degrade in the wrong browser/OS pair which means
testing all of your supported platforms for performance and turning off
features accordingly. The network stack is very hard to get right on all
browsers. Big surprises like Internet Explorer can't parse an XML file over
HTTPS if caching is disabled for the resource. Thats right. Now considering
that virtually all XML API calls out there disable caching, this is really
annoying. So basically we had to detect when a Flex client was calling our
services and remove the no-caching headers. And of course, since you don't
want to cache you have to add in a nonce on the url or it will never be called
again. Also, Flex can't by default handle anything other than HTTP 200 so
better recode all of you server processes to basically be Flex specific,
returning Flex friendly HTTP codes and headers. The Flex network stack is
simply pathetic. Our QA team tests the Flex application on all supported
browsers. They do not even bother anymore with the HTML portion because errors
have become so comparatively rare.

------
puredemo
Do you use jQuery for your ajax? That should resolve many of the cross-browser
issues.

~~~
pohl
There's nothing unique about jQuery in that regard. GWT would solve the same
issue.

~~~
teej
jQuery is unique in that he wouldn't have to change backends to use it.
Similar to Prototype/scriptaculous or Mootools. GWT requires a Java backend -
it's a non-trivial effort to move to.

~~~
nwatson
Check out [http://groups.google.com/group/Google-Web-
Toolkit/browse_thr...](http://groups.google.com/group/Google-Web-
Toolkit/browse_thread/thread/3e518bfd7ea88de1) for people using client-side
GWT with PHP, Python, .NET. There no absolute need for Java on the backend
with GWT.

------
butterfi
Why not HTML/CSS/JS?

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!)

------
kingsley_20
It's the texture. HTML/JS/CSS feels like paper. Flex/flash feel like plastic.

Shoptalk looks great btw. You'll probably want to allow multi-selecting users
- dragging them one by one can get tedious.

------
peoplerock
BTW: V. classy operation at SmallTalkApp... wish I could have entered a
suggestion via your "Feedback" button... without going through Bloomplex's
"question handling". Makes it feel way less like I'm actually connected with
developers of STA... taken away to "getsatisfaction.com ...

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.

------
gte910h
First off, flex is not flash. Do not confuse the two. Flex is the fast, just
works, flash is the pretty.

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

~~~
thenduks
Flex is absolutely Flash. It is simply a library/toolkit for Flash
development.

~~~
gte910h
ORLY? Then tell that to my current flash only performing client how you easily
add the flex libraries to his project.

Oh wait, you can't.

Seriously, they're not the same thing. Flex is a toolkit _that compiles to
swf_ but its not flash.

~~~
iron_ball
Definition troubles. Flex generates content for the Flash Player. The Flash
authoring tool generates content for the Flash Player. So do you define
"Flash" as "output runs on the Flash Player" or as "created using the Flash
authoring tool?"

~~~
cooldude127
output that runs on the flash player. that's all the users care about.

~~~
gte910h
That's not flash. That's swf files.

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"

------
mikeryan
Well first, you're writing a chat app.

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)

------
rgrove
Are there any screen readers that support Flex content?

(that's not rhetorical; if anyone knows of one, I'd like to know)

~~~
jdowdell
Yes, Flash Player has sent text to the big two (JAWS and WindowEyez) since
2002 or so, and is also supporting an opensource screenreader effort:
[http://blogs.adobe.com/accessibility/2009/08/adobe_supports_...](http://blogs.adobe.com/accessibility/2009/08/adobe_supports_open-
source_nvda.html)

(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.)

------
javery
this comment is loading....... loading.......

------
joeld42
I think you've answered your own question. Flex sounds like a good fit for
your project.

------
eldenbishop
The number one request in our user feedback forums is to get rid of
Flex/Flash.

------
kqr2
Is anybody using Flex for embedded systems? Any thoughts on that?

~~~
teej
While not a traditional embedded system, I built a HTML/CSS/JS/Flex app that
lives on a touch screen kiosk inside a museum.

~~~
kqr2
Did you encounter any problems while using Flex? Was it stable? Did it need to
be restarted often, etc.?

------
kingkongrevenge
I know it's not practical at the moment due to lack of deployment, but how
does flex compare and contrast with silverlight/moonlight?

------
amoffat
wow this community is friendly. i'll keep my opinions to myself from now on.
peace.

~~~
teej
Constructive comments and criticism, please. You are welcome to have and share
opinions, but please back them up with reasoning.

~~~
amoffat
So the rationale is, if an opinion isn't thoroughly explained, it's better
that nobody hear it, regardless of whether or not the opinion is valid or
makes sense?

~~~
teej
Abrasive words require support to back them up. Otherwise you're just calling
names.

~~~
amoffat
"polishing a turd" is an expression.
[http://www.urbandictionary.com/define.php?term=turd+polishin...](http://www.urbandictionary.com/define.php?term=turd+polishing)

also, why is there no reply link under your comment?

------
amoffat
in my humble opinion, flex is like polishing a turd. premature optimization.

