7 ms·
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?"
- n8agrin 17y agoFlash 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 17y agoLet'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/ 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 17y agothe 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 17y agoThis 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.
- deleted 17y ago[deleted]
- n8agrin 17y agoteej, I appreciate your response and dispelling any absolutes that I may have inadvertently spoken in. However, I don't think I spoke in strict absolutes by saying things like "As far as I know" and "Is the text always selectable & copy and paste-able?". I concede you're right, about #4 and your correction reminded me that as recent as about two years ago I used ActionScript 3 (or was it 2?) with a free compiler, as well as Flex (and I sure as hell didn't pay for any Flex compiler). Anyways, I'm not attacking Flex or Flash, I think both tools solve certain problems well. I was just trying to point out some broad issues with it that you, yourself concede exist. Apologies for that coming across as absolutes. You clearly have far more experience than I in the Flash and Flex world so thanks for your feedback.
- puredemo 17y agoDo you use jQuery for your ajax? That should resolve many of the cross-browser issues.
- pohl 17y agoThere's nothing unique about jQuery in that regard. GWT would solve the same issue.
- deleted 17y ago[deleted]
- teej 17y agojQuery 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 17y agoCheck out http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/3e518bfd7ea88de1 http://groups.google.com/group/Google-Web-Toolkit/browse_thr... for people using client-side GWT with PHP, Python, .NET. There no absolute need for Java on the backend with GWT.
- pohl 17y agoIt is a very common misconception that GWT requires a java back-end, but it does not: http://code.google.com/webtoolkit/doc/1.6/FAQ_Server.html#How_do_I_make_a_call_to_the_server_if_I_am_not_using_GWT_RPC http://code.google.com/webtoolkit/doc/1.6/FAQ_Server.html#Ho...?
- amoffat 17y agoin my humble opinion, flex is like polishing a turd. premature optimization.
- amoffat 17y agoalso, you're all gay
- lhorie 17y agoWhat 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 17y agoDon'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.
- teej 17y agoThanks for sharing this - you just sped up my Flex development workflow by a huge factor.
- hasseg 17y agoFcsh 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 http://hasseg.org/blog/?p=194
- nostrademons 17y agoIt'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.
- mrshoe 17y agoIn trying to answer my own question I had come up with some of the same ideas, but you put together a great list. Gracias.
- jawngee 17y agoFlex is aware of browser resizing. You can also handle right click/context menus.
- lhorie 17y agoI really don't buy the user-hostile argument. You write your code and you get a SWF. Youtube has SWFs. Newgrounds has SWFs. DeviantArt has SWFs. 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).
- moe 17y agoI'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 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 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.
- daleharvey 17y ago1. 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 17y ago1 - 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 17y agore 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 17y agoAnd the Javascript equivalent wont?
- amoffat 17y agowow this community is friendly. i'll keep my opinions to myself from now on. peace.
- teej 17y agoConstructive comments and criticism, please. You are welcome to have and share opinions, but please back them up with reasoning.
- amoffat 17y agoSo 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 17y agoAbrasive words require support to back them up. Otherwise you're just calling names.
- amoffat 17y ago"polishing a turd" is an expression. http://www.urbandictionary.com/define.php?term=turd+polishing http://www.urbandictionary.com/define.php?term=turd+polishin... also, why is there no reply link under your comment?
- wmf 17y agoYes, that's how HN works. As a reader, there's no way for me to evaluate a bare opinion. Should I believe it or not? Without any argument backing your opinion, it's just noise. See http://www.paulgraham.com/disagree.html http://www.paulgraham.com/disagree.html
- puredemo 17y agoStep one: Be provocatively insulting. Use gay slurs if possible. Step two: Complain of victimization. Step three: Profit?
- butterfi 17y agoWhy 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!)
- gte910h 17y agoFirst 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 17y agoFlex is absolutely Flash. It is simply a library/toolkit for Flash development.
- gte910h 17y agoORLY? 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 17y agoDefinition 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 17y agooutput that runs on the flash player. that's all the users care about.
- gte910h 17y agoThat'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 17y agoWell 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)
- kqr2 17y agoIs anybody using Flex for embedded systems? Any thoughts on that?
- teej 17y agoWhile not a traditional embedded system, I built a HTML/CSS/JS/Flex app that lives on a touch screen kiosk inside a museum.
- kqr2 17y agoDid you encounter any problems while using Flex? Was it stable? Did it need to be restarted often, etc.?
- jdowdell 17y agoYes. There have been past projects (if memory serves, Jaguar and BMWs, a yacht, Chumby, etc), but most of the action is now occurring in the next-generation cross-device Player, at openscreenproject.org.
- kingsley_20 17y agoIt'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.
- cookiecaper 17y agoI 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 17y agoIt 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 17y agoHearing 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.
- dimarco 17y agoWe'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.
- javery 17y agothis comment is loading....... loading.......
- RobKohr 17y agoAjax 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.
- peoplerock 17y agoBTW: 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.
- kingkongrevenge 17y agoI know it's not practical at the moment due to lack of deployment, but how does flex compare and contrast with silverlight/moonlight?
- camwest 17y agoWe'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.
- joeld42 17y agoI think you've answered your own question. Flex sounds like a good fit for your project.
- rgrove 17y agoAre there any screen readers that support Flex content? (that's not rhetorical; if anyone knows of one, I'd like to know)
- jdowdell 17y agoYes, 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_open-source_nvda.html http://blogs.adobe.com/accessibility/2009/08/adobe_supports_... (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.)
- eldenbishop 17y agoThe "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.
- eldenbishop 17y agoThe number one request in our user feedback forums is to get rid of Flex/Flash.