Welcome!

iPhone Authors: Jnan Dash, PR.com Newswire, Shelly Palmer, Kevin Benedict, Sarah Lake

Blog Feed Post

HTML5 or Flex Framework

More than a year passed since Adobe decided to stop supporting Flex framework and gave it away to Apache Foundation. This writeup is based on the conversation I had with my colleague Anatole Tartakovsky in January of 2013. In this conversation I’ve been representing the HTML5 community while Anatole fought for Flex framework. I’m trying to find arguments against using FLex framework even though I believe that it remains the best and the most production way for developing Web applications. I’ll be just playing devil’s advocate here. Anatole also believes that Flex is the best framework available today, but in our company we often argue about the tools to use for various projects. We hope that Web developers find this conversation useful and thought provoking.

Yakov. If you read this blog, most likely you know about our company, Farata Systems. Our engineers work on both consulting projects and develop a product for our sister company SuranceBay that creates software for insurance industry. Technology-wise, we have three practices:

1. Rich Internet Applications using Apache Flex and Adobe AIR
2. Web application with HTML/JavaScript/CSS
3. eCommerce applications (we have about 20 Hybris developers)

On the server side we use nothing but Java. We’re hiring people, but noticed that it’s getting a lot more difficult to find experienced Flex developers. Last week we made an offer to a Flex developer, but before accepting it, he asked me to share my opinion about the future of Flex. He knows about our company and is glad that he’ll be joining our team, but at the same time he’s worried that Flex skills won’t be a useful asset on his resume. I can read his mind, “I’ll waste a couple of years doing Flex, but my classmates, colleagues and the rest of the progressive mankind will be studying HTML5. Is it worth it?” I did my job defending Flex, now it’s your turn, Anatole, and I’ll try to prove you wrong.

Anatole. As I just learned, I’ve been working with useless technologies for 30+ years, and every technology I liked is not in use anymore. In my opinion, Flex framework has no future.

Y. What a nice way to defend Flex! Do you want to say that your programmer’s life was wasted?

A. I want to say that it was extremely interesting, but Flex has no future.

Y. Was this by M.Zhvanetsky who said, “Who cares about the soup if so much is going on in the kitchen“?

A. I’d rather say that Flex has no future, but it has the present. HTML5 has the future, but the present is dark and foggy. First, we need to decide if we live in the present or in the future. Second, it’s very difficult to properly guess the technology worth studying and using. Of course, the tools that are popular on the market will win, but they will also lose by attracting legions of low paid developers. Besides, being unproductive these tools won’t allow timely releases of high quality software. This leads to further degrading of software projects and programmers’ pay. There is a high end market, where more expensive and rare tools are being used by well rounded developers. And there is mainstream that uses various versions of HTML, Visual Basic and the like. These tools were never highly productive, but their better competitors could not attract even a one tenth of the developers community. At some point the psychiatric situation on the market causes people to not pay attention to the good tools, but rather go with the flow.

Y. Our company is not a typical one – each of the owners remains highly technical, and we don’t have any political reasons to select or reject any technology. Sure enough, we are very carefully monitoring the latest trends in the industry to be able to offer help in IT consulting. But we are down to earth people who want to deliver our own software as fast as possible without jeopardizing the quality of the product. You may be surprised, but new Flex projects are being started and the Flex-to-Flex redesigns are happening on the Wall Street – we continue getting requests for help. Such projects are typically run by smart and technically savvy managers who are not afraid to voice an opinion that may differ from the general software policy in their organiation. But an average manager does not want to take a risk and use a non-popular technology with a literally non-existent talent pool. Anatole is running the project where all developers know Flex and Java, and he’s not planning to switch to a different set of technologies any time soon. Why do you prefer Flex and AIR.

A. I’m planning to switch and will do so, when I’ll see a better than FLex technology that meets our needs. I agree to switch, but it’s like “Tomorrow I’ll marry the Queen of England. Half of this plan is accomplished – I agree“. The problem is to find a replacement. IMO, technologies like HTML5 will change the style of programming and the resulting product too.

Y. After making such strong statements, you need to say something to improve your credibility. Please tell the audience what did you work on in the beginning of this century.

A. There were no alternatives to HTML/JavaScript before the Flex framework was created. We had DHTML, HttpRequest and XMLHttpRequest, which was later branded as AJAX. The CSS capabilities were limited, but it was not that important because there was only one enterprise browser back then, and styling just worked without the need to worry about the incompatibility issues. We’ve been creating libraries having the functionality similar to ExtJS. They were not as polished, tested, and documented as ExtJS, but productivity-wise they were at least as good as today’s HTML5/JavaScript mainstream libraries. I was leading a team of 5 developers that were working on this library (XMLSP) from 1999 till 2004. But to create a product as good as Flex, the community would need to create 6-7 products that would comprise a platform that would include the following:

- a much more mature JSON that would support the skeleton generation on both sides
- a compiled JavaScript-like programming language (expecting to see it soon)
- an ability for creation of the finite state machine and CSS (give it another 2-3 years to appear)

Unfortunately, during the last seven years Flex didn’t have competitors. HTML is the future, but it’s a remote one. I don’t see it real in the enterprise applications for at least two years, but more likely till 2016.

Y. You’re talking about enterprise Web, not about small Web sites that can be easily developed in HTML5. All evangelists are happy to demo simple applications like Contact List to prove that HTML5 and their JavaScript framework is here to stay and is THE Framework to use. The rookie developers are often impressed by a demo of an HTML5 game moving objects using an HTML SVG element. To get cheap applauses at a Web conference you need to proclaim, “No more plugins like Flash or Silverlight. RIP!”. It’s even more effective than making fun of Internet Explorer.

A. True. If you want to write HTML5 application you need to seriously reevaluate what your application should be able to do. You’ll need to simplify it. A typical enterprise Web application serves the consumers that don’t use it anyway, and it also serves the professional business users that help consumers.

Y. Please don’t just make such ungrounded statements. Explain, what this means.

A. This means that consumers spend very little time using these Web applications – they they don’t use such applications from 9 to 5. These applications are being used on a weekly or monthly basis. The requirements for such applications are a lot simpler than for heavily used applications for professionals. The back office applications must increase productivity of business users and support a lot more functions. If you need to support wide variety of users, you’ll need environments allowing configurable applications that can be compiled and support quick refactoring for the new class of users or when the business requirements change.

Y. I agree that refactoring in Flex is more advanced than in JavaScript, but what are the problems with configurable applications?

A. By configurable applications I mean the ability to quickly customize the application with the same code base to support more complex or more simple interface and security. It’s not so easy to do with JavaScript, because it HTTP requests can be disassembled, you’ll have to deal with security problems, the code becomes more difficult to understand without having the compiler’s support.

Y. As far as I remember, Flash Player was also blamed for security holes, wasn’t it? Besides, since HTML5 is a mainstream, all major browsers treat security issues very seriously and all security holes will be closed a lot faster than any single vendor like Adobe, Microsoft, or Oracle would do.

A. The roots of Adobe’s security holes are in attempts to merge two incompatible security models of Acrobat and Flash Player. Now you can run Flash code inside PDF, which revealed security holes originated in incompatibility of the sandboxes. Most of these holes can be plugged by changing security settings of Acrobat and not by fixing Flash Player’s errors. But overall, Flash Player has less security issues than infamous cross-scripting of Web browsers and the likes. We are able to create secure Flash applications that would certainly had security issues should they be written in HTML5. What I really miss in Flash Player is the ability to integrate with telephony and work with peripherals that exist in natural environments. Unfortunately, Flash Player is not evolving fast enough to support new technologies for input/output and the voice interface. The main problem of Flash Player is that it was literary frozen since 2008. During the last four years Adobe didn’t do much to bring it up to date.

Y. It’s been more than a year since Adobe announced that their main interests for Flash are games and videos. You can’t expect any improvements in Flash for enterprise applications. Don’t forger that Adobe remains the owner of Flash Player, and no matter how great the Apache Flex contributors are, their hands are tied – the runtime is out of their control. I don’t like the way Adobe handled open sourcing of Flex, but they have business to run, and if they make money elsewhere, no one can force them to allocate proper resources to implement Flex and Flash Player improvements. Do you have any reasons to believe that Flex won’t lag more and more behind HTML5 technically?

A. I don’t have any hopes that Flex won’t lag behind. So far Flex and Flash player is still far ahead – we still live in the future comparing to HTML5. Yes, HTML5 has some features that make it appealing for enterprise and mobile development, and it would be great if Flash Player would continue evolving in these directions too. The main reason why Flash Player is dying is that ten years ago Adobe rejected Apple’s requests to create tools for their platform. Adobe considered this platform unproductive, and Apple had to recreate equivalents for all Adobe’s products themselves. After that, Apple stopped allowing Adobe’s products on their market. You can call it politics or personal vendetta, but unfortunately there is nothing you can do about it. Without Apple’s support Adobe’s tools will always have hard times. Will it change in the next couple of years? Not likely, unless the structure of both Adobe and Apple’s management will change.

Y. Based on what I see, Adobe won’t be willing to make steps toward Apple. Adobe prefers selling expensive and profitable software to corporations, and it’s not likely that they’ll return to Web browser’s plugins that are not welcomed by majority of the developers.

A. This is true for the most part. But historically, there were precedents when spin-offs were created to purchase some of the software products from large companies. Adobe is not the first company specializing in milking old cows (making money from old products). I.e they don’t improve some of their products, but purchase established third party companies and invest in cross-integration with their products charging the newly acquired customers for the new functionality. The chances are that non-profitable Flash platform can become a candidate for such a spin-off. Adobe might sell the Flash Player for a small chunk of cash to people who are interested in improving this technology. Unless this happens, Apache Flex is a still baby. I’ve attended several meetings in Apache Flex community, but I’ve yet to see people who can lead this community.

Y. There are lots of excellent Flex software developers in the world who could do it, but they simply can’t afford it. As I said, there is not many companies that can continue using a technology based on its merits. Flex experts need to make a living and feed their families. They can’t spread themselves thin doing both Flex and HTML5. They either work as independent contractors and want to keep their hourly rates high, or they work as enterprise employees and don’t want to go against corporate IT policies. Read the article “A Decade of Spices has come to an End” by Jens Halm’s, the creator of Parsley Flex framework. He basically says, “Sorry guys, I don’t have time to support Parsley – need to move on with HTML5″. Majority of Flex developers think like Jens Halms – they need to stay focused on one major technology to keep their skills in demand.

Our company is in minority, but we are not afraid to become known as one of the last Flex shops. We believe in hiring well rounded developers that are open to adding Flex to their skill set understanding that in a couple of years they may need to learn something else. By the way, some of the people are still doing Cobol and dine in Michelin-starred restaurants on a regular basis. The if-statement exists in every programming language. In some cases you’ll need to put a curly brace after if, and in some languages you need to write elseif as one word. Some languages support classical inheritance, and some – prototypal. This doesn’t scare me, but it seems that lots of people are reluctant to accept that learning something new is a way of life of professional software developers.

A. Of course, people have to take care of themselves, but if I were a young software developer, I wouldn’t worry that much about any particular technology. Let’s go back to the year of 2008, when Flash Player’s penetration on desktops was about 99% and no one could even imagine that this bulldozer could be stopped. Adobe offered to use ActionScript 3 as the ECMAScript standard arguing that they have a compiled and extended version of JavaScript, and Flash Player can be used as a virtual machine for the code produced by this language. Web browsers would simply need to recognize in HTML documents, which is an easy part.

Y. In the 90th, some people would even do language=”VBScript” for Visual Basic Script.Today, you don’t even have to specify that your scripting language is JavaScript – it’s a default in all browsers, and the language property is deprecated. Actually, you should be using the type property instead of language, and if it’s missed – JavaScript is assumed.

A. But browsers can support other languages, but there is no standard language. Sooner or later Microsoft and other companies that decided to deny ActionScript as a standard compiled language and solve the problems of performance and refactoring of JavaScript will need to solve these problems. And the future HTML6 or 7 will include a compiled language that will look very much similar to today’s ActionScript. Yes, it may have different keywords, support even more dynamic constructs and do a better job with eval, but the young developers doing ActionScript will be better positioned in three years than those who develop in JavaScript. Most likely, the ActionScript code developed today will be converted one-to-one to this new language of the future.

Y. Did you have a chance to get familiar with the Microsoft’s language TypeScript?

A. I haven’t. But when we were developing our own browser, when JavaScript would pass the first version of p-code we would create and cache automated objects to avoid recompilation of JavaScript.

Y. The syntax of Typescript extends JavaScript, but it supports static types, classes, and modules, and can be compiled into JavaScript, i.e. will require nothing, but JavaScript engine. On the other hand, Google’s Dart expect a browser to have a VM in addition to JavaScript engine.

A. No matter what language will win, the conversion from ActionScript will be mechanical more or less. It all comes down to your way of thinking and to the level of complexity you can afford in a compiled environment vs interpreted one. There is a major difference in approaches to programming in ActionScript
and in JavaScript. After spending some time designing and writing the ActionScript code you fix most of the syntax and refactoring issues during the compilation and linking stages . In JavaScript you can immediately test your code without getting error messages even if your code has the wrong syntax or linking problems. The time that Flex developers spend beatifying the code while writing it, JavaScript developers spend debugging their code in runtime. Programming in dynamic and static languages requires a big cultural shift. Developing complex projects in JavaScript is extremely difficult. If application developers have no prior experience in developing frameworks in JavaScript, they can only deliver Web applications with a set of relatively simple Web pages with limited functionality. Regular programmers who don’t remember what they have written yesterday, will have hard times debugging their own code. I’m not trying to insult people, but unless you can keep in your head all your code, the chances of producing well functioning large JavaScript application are very limited. I recommend to spend the next several years in a comfortable environment waiting till HTML6 or 7 will include a compiled language. In my opinion, when it happens, you’ll need to forget most of what you’ve learned about HTML5.

Y. I don’t agree with you. We didn’t talk about the development for mobile devices. You are talking about programming in a comfortable ActionScript environment, but why not spend a couple of years learning HTML5 methodologies and tools that would allow today’s Web developer digest the Mobile First concept, learn how to properly modularize JavaScript code, which frameworks to use in both desktop and mobile devices, what Responsive Design is about, is it possible to live with one code base for all devices or it’s better go hybrid or even native, and on, and on, and on. This takes a lot of time, and, putting yourself in the shoes of that young developer, spending these couple of years in learning all this new world won’t be a waste of time. By the way, in the book “The Enterprise Web Development” we show how to develop a Web application that will work in all devices from the same code. So I don’t believe that developing in Flex for a couple of years will allow this guy just to change the hat and start writing HTML/XYZScript/CSS code. I’m sure that just working in your team would make him or her a well rounded developer, but it’s not as obvious for other people.

A. If this developer would work in my team since 2006, he’d skip lots of frameworks like Mate or Parsley without losing much. People who say that their frameworks help in programming are the same that were promoting the Axe Soup before. One way or the other – good people is the solution. Frameworks rarely help. Tools do. HTML has a number of tools to test UI on different platforms. Similar tools were created for Flex and cross-platform CSS and skinning. But I don’t believe in miracles. I haven’t seen a single-code-base applications that work well on Android, iPhone, and desktop browsers.

Y. We need to compromise. In Flash Player applications you can choose pixel-perfect design: the user must have a 1024×768 viewport minus chrome and margins – my way or highway. But if you’ll need to make this application work on highly fragmented Android market, on iOS, Blackbery, desktops, and other devices, ask yourself a simple question, “Do we have money to hire two-three teams for developing and supporting several versions of the application for different devices or we’d rather compromise, and push the HTML5-based product out the door?” Money talks in the enterprise unless your project has unlimited budget. But if you’ll agree to compromise and move away from the pixel-perfect world accepting the fact that the Donate button will look a little bit different on different devices, go with the responsive design principles and have one code base. You’ll provide different CSS sections that will automatically apply different layouts based on the screen (a.k.a. viewport) size, but the HTML and JavaScript will be the same. I know, this approach has drawbacks cause some portions of CSS will be loaded for nothing to any particular device, but it can be a practical business solution.

A. People who promote the same design for different platforms usually talk about publishing information and not about interactive applications. If you need to publish the information using different layout managers, responsive design will help. But enterprise applications often have more than one target audiences. Consumers need an easily downloadable application and Web browser works fine here. Mobile applications should be compiled either into the native code or into some byte code that performs close to the native one. But UI must be different based on the available screen real estate and use touch interface.
If you’ll take any framework that works on both desktop and mobile devices you’ll get two sets of controls and the need to maintain two different source code.

Y. Nobody forces you to use any framework – just stick to JavaScript and, maybe, non-intrusive jQuery components and plugins.

A. Without frameworks I’ll have less UI controls to chose from. Frameworks may address the need in controls and convenience of UI.

Y. and browsers incompatibilities

A. Maybe. But when I hear that someone has the same codebase for the desktop browser and other devices, I want to see it and make suer that it doesn’t falls into the publishing realm.

Y. Of course, the Boston Globe site is a classical example of responsive design in publishing. But we can even take an application that we use in our book – Save Sick Child http://enterprisewebbook.com/#_responsive_design_one_site_fits_all. We have five areas (div’s) that include forms (a donation form or an online auction), each form is a separately loadable module, and if on the wide screen we could display three of these div’s horizontally and two underneath, on the narrow screen each of these sections will be scaled down and displayed one under another. And this is not just a publishing application.

A. When I’m porting an application to a tablet 800×600 with UI having large controls and fonts, I need to think about this application as a service to minimize the need of data entry. Don’t forget that half of the screen will be taken by a virtual keyboard, and if you ignore this, the user will have to work with your UI via a keyhole, and even these five separate div’s may not fit. So I’ll need to modify the UI and use the set of controls that will require minimal data entry. I don’t want to give the same UI to the consumers and back-office users.

Y. I keep trying to bring the money into our conversation, but you are avoiding this subject. Sure, it’s better to be healthy and wealthy, than poor and ill. But an most of the enterprise projects are poor and ill, i.e. have limited budget and not developers are not overqualified. Why a modern enterprise employs many low-qualified people is a subject of different conversation – let’s not go there.

Coming back to my five div’s, we can use CSS to hide what has to be hidden in certain devices, fonts can become larger, and we can use so called fluid grids to have our layout float. It may not be perfect, but it’s a compromise.

A. You can’t turn a truck into a car and then into a bike just using styling. I’m for complete redesign to use the features of a particular platform to its fullest. And the reason why IT has so many low qualified people is because these people allowed non-technical people to lower their qualification. We can help them to improve their qualification.

Y. Most people don’t want it. They live comfortably with what they know.

A. You and I are sitting now in a lobby of a fancy hotel that differs from a motel, right? Why? Because we’ve decided that the service has to be well compensated. And people working in this hotel do their job well. There is always market for the high-end things, which were produced better then others of the same type. If you’ll be producing low quality software, you’ll hate your job, which will shorten your life. Why?

Y. I hear you, but don’t agree with you. It’s great that you and I can afford now (it may change) to work only with interesting projects. But many young programmers have a long way to go before they will establish themselves to pick what they really want to do. Id your message “Just do what you like and the day will come”?

A. If you need to work hard to establish yourself, why doing it where the crowd is? Do it in the unpopular areas.

Y. Most of the people prefer to walk on the paved roads. It’s a reality.

A. Compare software and automotive industries. Some time ago you could have selected any car as long as it was black Ford of a certain model. Then General Motors started mass production of cars where people could select different models of different colors. By dong this they pushed Ford back. The software industry will go through the process of customization. We already reached the point when the software created for a certain enterprise is being replaced by a software-as-a-service (SAAS). The next task is not to create several versions of the same page with CSS, but understand what the user is doing with this page and to make it as convenient for the user as possible. If this will be happening, then software developers will transform into people who belong to service industries.

Y. I may disappoint you, but there were many attempts to cultivate a new creature – a cross of the user experience (UX) specialist and a software developer – it didn’t happen. These are different people with different mindsets.

A. in the end the winning applications will be not the ones that will have nice looking design, but those that will do what the user needs and will do it conveniently.

I have to finish this rather large transcript although our conversation didn’t stop here. Thank you for reading this far. I’m not going to give you a summary with recommendations or predictions of what tool or programming language is the best bet in today’s development of the cross-platform UI. Pick what you like, dig deep, and enjoy your work. It’ll pay off sooner or later.


Read the original blog entry...

More Stories By Yakov Fain

Yakov Fain is a co-founder of two software companies: Farata Systems and SuranceBay. He authored several technical books and lots of articles on software development. Yakov is Java Champion (https://java-champions.java.net). He leads leads Princeton Java Users Group. Two of Yakov's books will go in print this year: "Enterprise Web Development" (O'Reilly) and "Java For Kids" (No Starch Press).