Saturday, September 22, 2007

Adobe Flex First Thoughts: Part II

Isn't Part II of First Thoughts really Second Thoughts? Anyway... I was able to sneak into a two day Adobe Flex 3 training session two weeks ago, and here is my reaction. This is Part 2 in a 3 part series on Flex. Today covers the Flex Builder Eclipse Plugin, yesterday covered the Flex language, and next up is the Flex Server and Adobe Integrated Runtime (AIR) components.

As a word of warning... these are opinions generated by a mere 16 hours in training. Errors and omissions should be expected (that's what the comments are for).

The Flex Builder product is the for-sale development environment from Adobe. It runs within Eclipse, and features the usual code editing capabilities, a full debugger, and a beautiful visual page layout mechanism.

Editing Code
I previously stated that putting ActionScript, CSS, and XML within one source file was a bad idea. I've since learned that there are recommended ways to separate out these layers. In fact, mxml isn't needed at all and entire applications can be coded in ActionScript only. For simple applications, a lot of the pain of managing these concerns is alleviated by the code editing and navigation features of Builder. Code-folding and syntax highlighting helps here, but those features are really the bare minimum of what a modern IDE should provide. The IntelliSense and Auto-Complete features within Builder worked at a basic level. I found myself looking for the more advanced completion features though. Attribute lookup of XML elements is one thing, but finding advanced matches of object names in the project is another. The existing product is much better than using a text editor, but is still somewhat behind IDEA or Eclipse for Java. It sounds like most people are using statically typed ActionScript, so writing advanced features is not an incredibly difficult problem. So far Adobe has promised the "Find All References", "Move", and "Rename" refactorings. I hope Adobe is putting a lot of work into these features rather than providing a bare minimum and hoping the community fills it in later.

The Debugger
The debugging capabilities offered by Eclipse is an enormous improvement over debugging Flash or JavaScript. Coming from an Eclipse/IDEA background, it worked exactly as I expected it to. Bravo, Adobe, for fixing on of my largest pain points in Flash. You get all the usual debug windows from Eclipse: Variables, Watches, Breakpoints... Such an improvement over the trace() method (or God forbid the alert() method).

The UI Builder
The Flex UI builder picks up right where the .NET form builders left off. Which is exactly where the Java form builders dropped the ball. I've never found a Java form builder as nice as the one published with Visual Basic 6 in 1998. And I would kind of like the portion of my brain back that is currently in use holding onto all of the stuff about Java's GridBagLayout. Drag and drop widget libraries are nice. Visually aligning widgets is nice. Visually resizing widgets is nice. Humans are biologically visual people. We have forward vision to track targets (hunting food) and peripheral vision to watch for dangers (becoming food). We are built to look at three objects and quickly tell which one is the wrong size. We are not build to scan a text file and find two instances of the string ".x = 418" and one of ".x = 422". What are Java LayoutManagers if not a denial of human biology?

One last piece of information is that the Flex Builder has been reported to compile ActionScript faster than the command line version. While the comparison must not be apples to apples, (I'm sure they use the same compiler), there might be layers of tools needed to get the command line version to work, and the Builder may sense file changes and build as you work. To the end user, Flex Builder may indeed seem to build faster than the alternative, free tools.

Flex Builder 3 looks like a great, polished product. It is expensive. Most developers know that the price of tools is small compared with the productivity savings from those tools... but how many shops use Eclipse simply because it is free? And how many shops will use the Flex command line compiler, Ant, and some XML DTD plugins for auto-complete simply because it is free? I've heard both sides: the free tools are good enough, and Flex Builder is almost required for serious development. And I've heard them both from the same person! The download is free... decide for yourself.

1 comment:

Hamlet D'Arcy said...

As an update to this piece, I'd like to emphasize that Adobe has done a great job allowing round trip interpretation of the form data. You can edit the form visually, the the update is immediately in your source view, and you can edit the source view and immediately see the changes in the visual view.

This is where a lot of older products like MFC's builder and early NetBeans failed. Your visual layout code would be plopped into the source file and surrounded by comments like /*DO NOT EDIT THIS CODE*/. And if you hand edited the code the form editor would stop working. And your source code diff tool continues to work because there is no binary files stored anywhere.

Very nice Adobe!