I’m Officially Off the Flex Bandwagon
For the last year I have been a big Flex proponent. There are a lot of things I really like about it, I have come to the realization that it should only play a minor role in favor of standard HTML and AJAX.
Pros Of Flex compared to AJAX
- Cross-browser compatibility
- Naively Object Oriented
- Data binding
- Nice built-in controls (tables, trees, tabs, charts)
- Ability to write modular controls
What I am starting to find
- Debugging sucks. I don’t think there is going to be a way around it for our application. In both Flex Builder and InteliJ, the debugger expects to be given a .swf file to run, but I need to have my components run as part of a larger page, often times requiring a log-in page to be run first. This breaks what the debugger expects.
- You need to give your flex app a set height which wastes vertical real estate
- Resizing the browser window often makes it act goofy
- Flex steals Ctrl-T so you can’t open tabs like you would expect
- Drop down boxes and other standard widgets don’t look native
- Browser refresh doesn’t work as expected
- Browser history doesn’t work as expected
- There are still cross-browser differences, especially around networking (HTTPS issues, long polling issues, and more)
- The .swf files are relatively large and take a while to load which makes for a bad user experience
- EVERYTHING needs to be transferred via web service calls, even reference data
Because of this, I now feel that piecemeal half Flex/half HTML applications are a bad fit. My initial views of Flex was that it should make web development better, even if it was taking a while as I was getting up to speed with it. Now that I am relatively proficient with it, however, development is still taking too long.
The lack of debugging in particular is making it very difficult to work with. Having to make and manage REST APIs for everything adds a lot of complexity. And it still isn’t really that pretty looking. Despite a lot of early promise, the cons are definitly outweighing the pros.
In the end, I think JQuery will do as good of a job of abstracting browser differences as Flex does and will keep the app more browser-native and debuggable.