Flex + Mobile = Mission Abort!

July 16, 2014

Me and the wife where sitting on the couch the other day; both of us fixed on our respective electronic device.  I was on my laptop launching some Kerbalnauts into space while my wife was on the IPad trying to plan out a bathroom remodeling.  She was getting particularly frustrated in this task, and not for the usual reasons.  She was trying to find one of those drag and drop remodeling web-apps; the ones that help you sample different colors and fixtures. She found plenty, but they all failed to load in the IPad’s browser.

“Greg, the IPad wants this flash player thing.  Get it for me.”

“Can’t.”

“Why not?”

“Apple doesn’t allow the Flash player on IOS.”

“That’s dumb, they should do that.”

Long-story-short, I had to abort my interplanetary mission and hand the flash player equipped laptop over.

This little interlude also put my mind into the way-back machine.  Back eight years ago(that’s like 150 in tech years) when I first heard about this new web application framework called Flex.  I was working at a company that specialized in receivables management software.  I was just a year  out of college, but was lucky enough to get put on a team working on prototyping technologies for their next big product.  The current product used a VB client for it’s front end, and Flex was our first choice to replace that portion going forward.

At the time, it was a great choice. Flex allowed for all the rich UX features that could match the functionality of the current product.  I hadn’t been exposed to too much web-development in my career at that point, and Flex felt very comfortable to develop in.

When I came to work at SEP, I brought along Flex as one of the skills in my toolbox.  My experience with it led us to using Flex over Silverlight for the development of our internal time accounting tool.  But then I got pulled into native desktop development for several years.  In the mean time, this happened:

IPhone_2G_PSD_Mock

Poor Flex.  First casualty of the smart phone wars.  You never stood a chance.

Flex was a very advantageous tool in it’s time.  It was one of the first frameworks to link a declarative UI markup with an imperative scripting language through two-way data binding.  Web Service integration was also nice and simple.  It supported server side push if you wanted to pay for Flex Data Services.  It thankfully spared developers from ugly DOM manipulation through JavaScript to accomplish rich UX.   And don’t forget, the vector graphics and video playback from the Flash plugin really set it apart from what you could do with the browser otherwise.

While the rise of mobile didn’t completely kill Flex and the Flash plugin, it did make it much less of an optimal choice.  You where left having to abandon you mobile users or build separate web-sites or native apps to reach them.  So when you wanted to reach the most users with your app before Flex, you where left having to use hacked together JavaScript with HTML.  What are you left to do now?  Pretty much use hacked together JavaScript with HTML.  Fortunately, that option is much improved from the pre-Flex days.

HTML5 and CSS4 brings much of the visual power that was only available in Flash before.  Through these new versions, browsers can support vector graphics and video playback without the Flash plugin.  While not quite as powerful and feature rich as the fully mature Flash player, it’s good enough for what 90% of applications need.

The java script libraries have improved greatly as well.  JQuery along with the switch to Restful/JSON over SOAP/XML has made web-service consumption from the browser much simpler.  And several application frameworks have risen up to better bridge JavaScript models and logic with HTML visuals.   Libraries like Angularjs, Emberjs, WinJs, and Backbonejs provide the architectural support to integrate your client side scripting with HTML fluidly. Angularjs even provides two-way data binding between HTML and JavaScript; allowing you to architect apps much like how you would with Flex.  None of these libraries are a full replacement for Flex, but they are each, in part, bringing some of the best patterns and lessons from the desktop development world to the web.

There are also some frayed edges to deal with here.  HTML5 isn’t completely or consistently implemented across all browsers.  And web development is still a bit alien to a desktop developer in a way that Flex wasn’t.  You need a much broader skill set and knowledge of the tools out there to accomplish a given task.  It’s not the all under one roof approach that Flex provided, but you can tailor your tool selection to the requirements of your application.   So if your web site needs some of the rich UX features of a desktop app, the technology has evolved to make it happen without the Flash plugin.  So stop using.  Otherwise my wife’s going to keep stealing my laptop.