Thứ Hai, 24 tháng 11, 2008

Flex: More Like HTML or More Like Java?

Joshua Partogi recently posted Why You Might Not Want to Use Flex on his blog. I found this blog entry particularly interesting because Joshua does not focus on the usual criticisms of Flex (which often are actually of the Flash Player) and because Joshua's experience is almost exactly opposite of mine. While I have generally found Flex to be significantly easier to use than any other web development frameworks that I have used, Joshua seems to have found both Tapestry and JavaServer Faces easier to use than Flex. As Joshua alludes to in both his blog entry and the linked-to presentation Switching Paradigms: From Regular Web to Flex, it is really a matter of experience and perspective.

I consider myself first and foremost an application developer with my primary interests, experience, and skillset focused on things like Java EE. I have, of course, written many web front-ends with JavaServer Pages, Struts, and several other web frameworks to a lesser degree. All of these web frameworks offered advantages and I appreciated the abstraction they provided me. However, the real problem was not the frameworks themselves. The one area that still felt like I was hacking stuff together was the implementation of dynamic behavior in the web browser via JavaScript and DOM manipulation. I also grew increasingly frustrated with the world's most popular web browser not fully supporting some of my favorite Cascading Style Sheet effects. For me, Flex was a breath of fresh air with its hiding of browser idiosyncrasies and the ease of implementing stunning new interfaces with highly dynamic behavior. I was hoping that Java would get a framework as compelling as Ruby on Rails and, for me, this was it.

This brings me back to perspective. While Flex itself is obviously not Java, it shares so may characteristics with Java and is so easy to integrate with Java that it almost feels like an extension to Java. Because I have always strongly preferred Java over JavaScript/DOM/CSS, it is no surprise that I found Flex and even ActionScript to be so refreshing and liberating.

I appreciate Joshua posting this blog entry because it reminds me that not everyone thinks the same or shares the same experiences. No framework or tool or product can be everything to everyone all the time. However, Flex has really left an impression on me, on the vast majority of my colleagues who have given it a shot, on and many others whose blogs I read. We all come from similar backgrounds with strong Java experience and have been spoiled by the ability to write code once and run it on virtually any operating system. For us, the idea of a web application written in Flex that can run on virtually any web browser is "how things should be done." Having to write code to take into account different browser vendors and even different versions of the same vendor's browser and having to test our applications every time on several different web browsers seems unnecessarily time-consuming.

I can appreciate how Flex/ActionScript's static typing, class-based object-orientation, and obvious Java-influenced characteristics can be foreign to someone who spends most of their web development in the HTML/CSS/DOM world. While Flex does offer support for these specifications to varying degrees, it certainly is not exactly like these and does require some learning and a new way of doing things.

I'm a strong believer in "to each his own." For me and for many people like me, Flex is the best thing to come to web development in a long time. For others, they may be perfectly happy with what they're using and have grown comfortable with. I have found that the best motivator for me to learn a new language, technology, toolkit, framework, or other product is some pain with my current language, technology, toolkit, framework, or product. The pain has to be consistent enough and of sufficient degree to motivate me to look at something new. While I have found some corner cases with Flex that are a little tricky and have found some things I'd prefer to see implemented another way, I have not experienced enough pain to really consider an alternative at this time unless something revolutionary comes along.

Joshua's last paragraph provides the advice that I'd reiterate to anyone who is unhappy with their current web development experience: don't take my word, the word of other Flex enthusiasts, or the word of people unhappy with Flex as the final word. Because we're all different, we have to find what we each like. I think most people who give Flex a fair try will like what they see.

Michael Martin, a fan of both Flex and Linux, informed me of the recent release of an alpha version of Flash Player 10 for 64-bit Linux. He is excited about this and has been happy with its performance so far.

Không có nhận xét nào:

Đăng nhận xét