Sencha Ext JS is Viable Technology Choice for Flex Developers

Below, I describe my experiences with Ext JS after the Sencha Fast Track training, my challenges with doing browser based work in a consulting context, and my thoughts on why it matters to Flex Developers.

I’m in a hurry.

I don’t want a history lesson.

Get comfortable, this is long.

Preface

I had the pleasure of attending a 5 day fast track for Sencha’s Ext JS 4 in New York last week with my partners from Web App Solution. Of the 13 people that attended, 7 were Flex Developers working on Enterprise Applications. Yakov and Victor from Farata Systems were there and Universal Mind had John Yanarella representing.

While the technical future of Flex is extremely bright and exciting, the business and marketing future of it is over. Adobe, with the community’s help, has ensured that it is in the best hands with the Apache foundation. With a multitude of capable, brilliant, and diverse contributors to the open source project, there are definitely a lot of great things on the horizon for the next Flex SDK.

Adobe has also ensured, intentionally and unintentionally, it has a limited future which will ensure Flex is no longer invested in any technical capacity from small, medium, and large businesses unless absolutely essential, or under the radar. The mobile revolution has happened, and while Flash had the opportunity to play a pivotal role, Macromedia, and later Adobe have failed to take the initiative and successfully execute on it.

While there is still a significant business & technical advantage from a design, development, and workflow perspective in the Adobe AIR stack for developing & deploying on Android and iOS, Adobe has made it a clear that they perceive it is an opportunity they are not interested in pursuing on the developer front. This is a huge topic mostly discussed from a technical perspective in the community, and only a select few blog articles got it right from a business one… and even then, those missed it from a technical perspective.

Bottom line, Flex Developers are between a rock and a hard place in the industry right now.

The type of work they do for desktop web applications is different from what Flash Developers do, mainly in team size, project scope, and client base. It’s not as simple as “just use jQuery, and move on”. While the tools & runtime we use are technically sound, even clients who have a technical understanding of the marketplace & toolset will not invest in a perceived abandoned platform. Server-side offerings do not offer the rich client experiences we’re used to creating. The plethora of frameworks in the web market, both open source and proprietary, do not offer the same tooling, performance, and expedient workflow we have on the Flash Platform.

… except Ext JS. Sort of.

As stated by John Yanarella at the training last week:

“Out of all of the web based frameworks out there, Sencha’s Ext JS is the best safety net there is for Flex Developers.”

It has the necessary component framework, a growing company with enough resources & funding at a specific size behind it, with a competent web & mobile technical story that has the potential for critical mass within an Enterprise context.

Thus, given my company’s need to offer my clients an HTML5 alternative to Flex, Ext JS seems to fit the bill. Considering time is at a premium nowadays, the fast track training Sencha offers seemed like a great opportunity. And I love New York so any excuse to go there is great.

Given the whirlwind that was the past 3 months, as well as reflecting upon what I learned from the training, I thought it prudent to write down my thoughts here. There are a lot of Flex Developers who are looking for direction, so I’m hoping this is one for them to follow.

Background

As a Flex Developer faced with a forced career change driven by forces beyond my control based on the infamous events of November 9th, 2011, I had 2 choices. Do what I always did back in my 20’s and dive headlong into the unknown, or let the pioneers get the arrows in their backs as it were. Now that I run a business and am a father of 2 children, I don’t have the free time I used to back being single and W2. Flash & Flex, even on death march projects, allowed me to get up in the morning fueled by the passion of using my favorite technology, and attack problems full bore.

Surveying the landscape, things were pretty grim… even for someone positive like me.

While the iOS stack had a clear advantage with both a growing developer base, mature tooling & framework, and customers who actually paid for content, none of my large clients actually had initiatives around iOS work. Enterprise applications, known for their copious amounts of input needs from the user, do not translate well to the small screen size and lack of keyboards on smart phones and tablets.

As such, while the uptick in service based software shops servicing the needs of clients who need iOS applications has increased, the scope of said projects is not as large and often is more consumer based. The latter is troubling as it’s hard enough utilizing ActionScript 1 in a deadline driven environment that Design Agencies employ; dodging technical debt for as long as possible in Objective C, even with superior tooling is not appealing when longer and more profitable projects exist with the opportunity to have competent peers beside me vs. being a lone wolf. Learning a lower-level toolset for shorter engagements that pay less makes it a non-starter.

Android, while being easier to deploy to as well as more easily iterating with your customer base, is notorious for it’s fragmentation, both programming and design. It’s hard enough for designers to lessen the overall experience via responsive web design to compensate for a variety of screen sizes. You now have developers who cannot turn as fast as designers can and thus have to spend more time on a platform that doesn’t generate nearly as much, if any, revenue from consumers compared to iOS. This doesn’t even broach the business topic of how do you lessen the maintenance cost on your customer when they have to hire both an iOS and Android developer, or some awesomely expensive hybrid who can do both, to handle both platforms. The other bizarre thing about Android is that it is taking the PC approach to competing on price with iOS and continually increasing market share, yet doesn’t seem to be generating the service revenue compared to iOS (ie people who own Androids don’t buy apps as much as those on iOS). Same problem as iOS: Invest in a lower-level technology with massive fragmentation for shorter projects that pay less money… again, non-starter.

The multi-development & deployment problem was what the web was supposed to solve. While native development does give you significant user experience & tooling advantages,   it seems wrong to invest my career for applications that my current client base do not target. Every single large client I’ve had treats mobile as either a fun skunkworks project, experiment with no perceived ROI, or as a necessity with the minimal amount of money devoted to it, sometimes taken from another project’s budget ad hominem.

Both don’t bode well for a future career from a consulting perspective in mobile.

While consumers bringing their smartphones, tablets, and technology of choice to work has had a huge impact on large companies, most Enterprise customers still target the desktop web as the main avenue of both B2C & B2B based revenue. While many have made huge and wonderful strides in providing value for their mobile websites, it’s clear many either provide a lot less functionality than their desktop counterparts, or strain at even that.

With large media companies it’s a little different. Studies have shown that tablets are better at allowing consumers to consume content whereas desktops/laptops are better for producing content. While “duh”, having studies like this made and corroborating themselves verifies what we already know. They have a vested interest in increasing consumers ability to purchase and access that content in a controlled manner.

The problem here is that the budgets for those projects doesn’t increase with the needed targets.

For example, while working on HBOGO.com, the initial release of the iPhone app did not allow you to watch videos. The Flex app we did at the time was the only way to view videos. Overtime, it was prudent to support both iPhone and iPad versions. A lot of companies, however, don’t magically get 2 budgets, 1 for the web and 1 for the iPad just because the iPad is so cool. While the GUI’s needed for iPhone and iPad are simpler, you still want to create the same user experience for the customer, especially if they are using all 3 to access their content. The Iron Triangle verifies that something must give, and thus, the scope/functionality/user experience often does.

Investing in a mobile technology where consumers pay less, and larger businesses devote less capital to the same projects doesn’t bode well for investing the smaller portion. If I were back in 2002 still doing design agency work, I’d totally be an iOS developer right now. As a consultant who does more than build software, and who doesn’t see his clients changing their plans, I see no prudent reason to go the iOS/Android device route. …… beyond them being really fun (another story).

Appcelerator, Corona SDK, Sencha Touch, and PhoneGap, technologies which allow you to deploy to multiple mobile platforms with mostly the same code base and skillset, can be lumped in the same bag as native with the above perspective.

Why invest in technologies that offer less money and my clientelle isn’t using?

On the flip side, the HTML5 moniker has taken on a life of it’s own. While not necessarily  representing the full JavaScript, HTML, CSS, and associated libraries & frameworks stack, a lot of clients big and small have been sold the bill of goods that it solves the same multi-platform, multi-device problem that the Flex/Appcelerator/Corona/Touch/PhoneGap attempt to solve: single code base, single developer toolset, and multiple targets within their same organization.

I won’t get into the phenomenon that is HTML5. All you need to know of the context of this post is that a lot clients either suddenly think HTML, CSS, and JavaScript can provide the same experiences we can do in Flex for the same price using the same teams… or they know it’s false, but either their Board of Directors or Business Customers force them to use the tech anyway for political reasons that have nothing to do with engineering ones.

The Challenges of the New Platform

The issue, however, is that it’s not that straightforward. There are 5 main issues that the HTML/JS/CSS stack (which I’ll here after refer to as the HTML stack), have when coming from the Flex platform in a consulting context (there are more, but these are the ones that matter with regards to the context of this post). They are:

  1. DOM as a dynamic display technology
  2. JavaScript lacking mature language constructs
  3. There are larger problems for multiple Browser Vendors to solve
  4. the industry’s libraries & frameworks are young from an Enterprise context (yet not!?)
  5. The Video Codec Issues
  6. Tooling

The Document Object Model

The HTML DOM wasn’t made to do the type of applications we do in Flash, more specifically Flex. Flash Player was developed specifically around cross platform visual fidelity with a web bent. More importantly, though, it was built around redraw. This perspective of “frames per second”, and continual improvements around the underlying timing of redraw, building upon what a platform does well, and then abandoning a “new” 5 year old display technology to support a GPU future.

Browser vendors are doing some pretty amazing things with the DOM, from hardware accelerating the display, continuous redraw optimizations, all the while doing their best to follow ever evolving standards amongst our changing technological landscape. …based on a tech designed and created to show text. That’s awesome.

Sadly, the redraw performance isn’t awesome. While a lot of Flash and Flex developers never really got the purpose and value of invalidation in Flash Player, even with a technology created for displaying and animating composited graphics, as your application scales, it’s easy to create a system that redraws too much. Invalidation helps mitigate (usually solve) that problem for 90% of the use cases in applications. In a nutshell, it means you can set properties on your visual components as much as you want to in a single thread and ensure it only actually redraws the screen 1 time.

For browser DOM’s, this is exemplified even with the drastic CSS improvements. The philosophy is to never redraw the DOM if you have to, and if you do, do so on the smallest section possible. Browser toolkits such as Ext JS,  Dojo, and some others do this very well. While they have the advantage of browser CSS to help mitigate some of the redraw performance drags, compensating for both past, current, and future browser incompatibility in an easy to use & scalable API shows just how brilliant some of those browser developers really are. Based on what I’ve continued to read, this seems to be getting better although not as fast, nor as widely deployed, as Flash Player did which means the problem isn’t going away soon and thus the need for x-browser, x-platform invalidation continues to be important. Thus, Ext JS’ commitment to efficiently redraw the DOM is appealing.

One thing John brought up at the Ext JS Fast Track training last week was the lack of positive sales around hybrid solutions: using Flash Player and the HTML stack together. If you need to play video or animate/show a lot of composited objects, combining the 2 technologies together.

Hulu and YouTube proved it can work with video and movie subscriptions. Grooveshark proved it can work with music (and video, heh). Google Finance and Analytics proved it can be done with charting.  Balsamiq proved it can be done with desktop designer tooling.

Bottom line, things are pretty bad but getting better slowly, and there are mitigation paths that can utilize Flash Player in the interim. Canvas is finally getting hardware acceleration across platforms also making it another another tool to help.

This doesn’t seem to be getting much play, but considering we’re all supposed to magically know a multitude of platforms, languages, and yet have multi-talented sub-contractors that meet that criteria and deliver the projects in the same time frame clearly means that option is also on the magical table.

JavaScript in the Enterprise

Surprisingly for me, JavaScript the language has dominated the discussion the past 3 months in where I’ve lurked in social media circles amongst the Flash & Flex Developers. For those of us who grew up in the industry and our careers with Flash, it came quite as a shock for the industry to fall back in love with JavaScript.

While it made sense for server-side developers to reduce their code size as more logic goes to the client and their servers get faster and cheaper, we’re still a little confused as why the industry isn’t salivating for a statically typed Harmony (resurrected, non-elven remains of ECMA 4).

Most of us Flash turned Flex developers grew up using ActionScript 1. For those who don’t know, this is near exactly the same as JavaScript/ECMA 3. The difference is instead of doing an innerHTML on a div tag, you just call methods/properties on a Sprite. As our projects grew in scope and # of developers, the language started to show its scalability problems. You’d run into more and more null pointers from misspellings, even with better tooling to help provide code hinting. You’d also get errors, but no clue where they came from since there was no common way of handling errors in ActionScript 1.

Furthermore, if you didn’t provide source, the developer was screwed because there was no way to easily introspect API’s unless you read the documentation or source; things like Aptana didn’t exist back then. This also implied, however, that even though there were things that weren’t public, developers would still call them anyway if they didn’t understand your name spacing convention (such as using an underscore (_) prefix for private variables and method names). While Lua and other languages have tricks using closures to emulate access modifiers, this never caught on in the early Flash world. The path for RIA’s at the time was larger projects with larger teams, and thus they adopted a more Java esque method of language development while still trying to match ECMA 4 as best they could.

Finally, loose typing/variants also made it harder (in theory… which has been proven wrong by Google’s V8) for Macromedia/Adobe compiler engineers to make the language run faster than JavaScript.

Thus, the natural evolution was for a strongly-typed language with proper packages and namespaces (or access modifiers like public/private) to help us address the larger applications we were developing. It did. It was, and is, awesome.

…for some. About the same time as I started getting more consulting, I also started noticing a larger awareness to the different types of businesses using Flash and Flex. In the Design Agency world, the majority of the work was 2 months to 2 days, and in between. The teams were often 1 developer; if there were more devs, they both weren’t on the project the whole 2 man months. They hardly ever payed their technical debt (unless you were a consultant with them). You started to see a strange love/hate relationship for a lot of these devs. In some cases ActionScript 3 helped these developers, who were on a deadline and often never paid their technical debt, manage said technical debt with AS3’s improved strong-typing and runtime exceptions with the ability to use loosely typed constructs when needed or in unknown territory.

On the flip side in the Flex world for larger companies that gave a flip about design, and more about feature count, the language constructs were barely enough. Constantly we’d get barraged from developers in more low-level languages like Java, C#, and C++ about why is AS3 is missing this or that (true Singletons, true Abstract classes, threads, blah blah blah), and how do you emulate such features.

It was very clear there was a split was growing. I could elaborate on all the niceties, but suffice to say, the Flash Devs didn’t need all the language features & strict complexity rules whereas the Flex Devs couldn’t get enough. Again, a simplification on the nuances of  a thriving, diverse, and changing community, but accurate.

Most of the Flash devs have had little trouble beyond the first 2 hellish weeks of getting immersed back in the DOM, CSS, and JavaScript variant world… only with better tooling and libraries + choices than they had 7 years ago when they 1st abandoned it for more creative pastures.

The Flex devs, however, haven’t seemed to budge en-masse. We have people telling us we don’t need those things in a language, yet when we ask them to show us a large Enterprise Application that utilizes JavaScript, they either are using an intermediary language to compile to it (Java in Google GWT or Oracle ADF, C#/VB in .NET, or CoffeeScript), or just can’t deliver the goods. Same excuse us Flex developers gave the Slashdotters around “show me a cool app built with Flex”: “It’s behind the firewall”.

There’s also a lot of misunderstanding about simple things like OOP. Using Object.prototype for “emulated” classes is what I did for 4 years… I have no major qualms about going back. Ext JS in version 4 abandoned this practice as well. While I grew up with Object.prototype insanity and learned to love it, the debate vs. clsoure/function inheritance vs. Object.prototype rages still. If you care, Keith Peter’s has a good article on the nuances of it, or you can read what I did to learn ActionScript, Robin Debreuil’s book.  There are others, but the point here is we Flex Devs expect classes not just for encapsulation, but create organized code with a common workflow to share code amongst many developers. JavaScript wasn’t made for classes, but using Object.prototype or the closure method in a declarative manner works just fine (like ImpactJS or Ext JS does).

While I like Keith’s take and respect his opinion, not having classes and encapsulation won’t work in large teams, often setup to fail at the outset by politics, nor all being Keith Peter’s caliber (me included). The other option to “not working” of course (Goonies never say die), which I’ll cover later, is that it’ll just take longer and/or we’ll accomplish less. The rules of Mythical Man Month, Technical Debt, etc. still apply regardless of  language/platform. It’s worse in Consulting when coding software, extremely hard in it’s own right, is the least of your problems.

Compiling to JavaScript

In fact, some are so staunchly opposed to utilizing JavaScript as a serious language to build Enterprise Applications, that they’ve investigated alternatives to compile TO JavaScript using an intermediary language. This has long been the process for server-side platforms with a variety of templating engines out there that make it a hybrid process of injecting data into your HTML. The problem is, they either have a server-side bias, or aren’t ready for prime time in a large Enterprise Scale. Remember, you can’t just be good; you have to have money, a company of decent size behind the tech, funding, and have reached critical mass for your product.

While the reaction was very positive around the work Adobe was doing with FalconJS for those in attendance at the FlexSummit, it was very clear to me it was a science experiment with no hope in providing the needed migration path for Enterprises. The amount of work, resources, and time needed to bring it to Oracle ADF, Google GWT, or .NET caliber is clearly something Adobe didn’t seem willing to devote. That, combined with their clear direction of no longer focusing on developers.

Google Dart seemed like a light at the end of the tunnel. It, too, however, seems to be a science experiment of Google scale. It has all the hallmarks for a bright new project:

  • Google is behind the engineering effort
  • has a strongly-typed language that, like CoffeeScript, not only sets out to improve upon JavaScript’s problems, but provide mature language constructs you need in larger applications within the language itself (unlike CoffeeScript’s/Google Closure’s/TypedJS annotations
  • has 2 compilers: 1 a Flex Developer would use (dartc) and 1 a Flash Developer would use (frog).
  • is based on Eclipse (good and bad, let’s just pretend the good parts here)
  • brought on Alex Russell of Dojo fame to take a fresh look at the DOM event API
  • Cliff Hall of PureMVC fame (multi-language framework used a lot in Flex) made a first version port for Dart.

…yet doesn’t seem a priority since while a web based technology, it still hasn’t reached critical mass, nor does it show any signs of doing so yet. I’m more concerned about the amount of resources I’m seeing being devoted; maybe there are more, and like all things Google, they just don’t advertise it. I really wish I could just parachute drop a Porter & Bogusky contingent in Google someday…

So far, the only contender is CoffeeScript. Here is a video and slide presentation to check out on if you have time. However, Ext JS uses declarative JSON + JavaScript. I have not seen any signs to see if Sencha is interested in porting Ext JS to Dart. Just say it… “Ext Dart” (pronounced “X Dart”); sounds like a dope dubstep ninja weapon, right? You’d certainly get better jokes from non-tech savvy people at parties when someone hears you’re a “Flash Developer”.

The other problem is that you need everyone in your organization coding the same language. In product companies, it is TOTALLY fine to have a technology du jour with Ruby running your builds, PHP running your render farm, and Java running your back-end, but for development purposes on 1 particular platform, you standardize on a language and usually have company ordained standards on it. This is for maintenance costs, and hiring standards, and a variety of other reasons that aren’t just around cost.

If anyone has CoffeeScript running atop Ext JS, let me know how you got your build process setup.

Browser Issues

Notice I’m specifically talking not just about incompatibilities between browsers, but missing features. For example, just 3 days ago Google added weak collection keys into V8 (their JavaScript engine for Chrome). Developing data models with string based keys can be extremely hard for complex model logic. Having a Dictionary (or Object) that can use something other than a String as a key is extremely useful… until you have to remember to kill the key when the object is destroyed. Enter weak keys and queue the “woo hoo!”.

One of the great things about Google’s approach with Chrome is not only is it the fastest updating piece of software that matters in history (faster than Flash Player), but they iterate quickly on features. While we’d wait 18 months for AS2 and then 24+ months for AS3, and in between get language updates… JavaScript is getting that piece by piece. It’s a wonderful thing, but also brings up a larger issue.

What do you today?

You have to do SOMETHING. Given each browser implements different features different ways, and JavaScript’s functional + prototype nature, you can easily (*ahem*) abstract away these problems into a useable API that hides the differences. Certain low level things like maps can be tricky, however, and come at the cost of performance, library maintenance costs, etc.

Fine, no big deal, you just move forward using an Object hash approach. We’ll just wait a couple of projects before maps + Dictionaries catch on in all browsers.

…but what about Web Worker (also known as threads for web developers)? It’s only supported in IE9 while Firefox/Safari/Chrome are good to go. While you can emulate via green threading, this is a FAR cry from emulating the lack of getter/setters in older versions of IE, or even emulating Canvas for Internet Explorer 8 via a VML wrapper. Those work. Green threading is not the same thing as a separate process that ensures it doesn’t lock up your GUI thread. The lack of full browser support will prevent some features from actually working and there aren’t any fall backs that can be utilized.

For some charting/plotting applications, these are essential features: no web worker, no application. Now in Flash, you’d just plan around upcoming features, both those you voted to be actual features, or those you knew were coming down the pipe. One tactic of design agencies, and Macromedia/Adobe in general was to have them launch a high profile app/site/widget to showcase these features upon launch.

If you are to inspect all upcoming features in browsers, not just JavaScript, but CSS, hardware & display related, etc. it really slows down when we expect certain experiences in our applications. While Macromedia/Adobe would drag their feature on certain things like right click and threads, the process was generally the same:

  1. identify a problem you had on projects
  2. bring it to your peers & Macromedia’s attention
  3. rally support through email list/blog/twitter posts/talking to company reps at conferences
  4. make writing & validating the use case easy
  5. get community votes when desperate
  6. await new feature(s) in upcoming Flash Player, beta test if lucky

While this process for Chrome seems EXTREMELY quicker, for the rest of the browser market as a whole, including smart phones and tablets, not so.

My college professor said, “There will always be work to be done.” Unless we use hybrid implementations, clients will just have to live with the slower pace of innovation if they want broad adoption. I guess I’ll live, I’m just curious where my excitement will come from if the toys remain the same, or only 1 browser implements a new feature I can’t easily abstract. That, and it seems a lot of innovative projects will either start to be browser specific feature branches, or just wait for broader adoption amongst modern browsers. It’s sad. And frustrating for both my clients and my team.

Wild West: Libraries and Frameworks

What’s fascinating to me about the JavaScript landscape is how much longer it has been around with a lot more people and yet the landscape with regards to frameworks and libraries is still in major flux on a few fronts.

In the Flash World, there were 2 frameworks that people would use, if ever: ARP and… just kidding, 1. While the tweening libraries got a little out of control, and the component frameworks became pretty niche, overall there was a library for everything, sometimes with an alternative if you didn’t like one particular implementation. A lot were ported from other languages, like Java and C/C++.

Frameworks didn’t really start to rear their head until Flash RIA applications started to become mainstream, and Flex was born. The Java developers coming over didn’t see any common MVC/MVP/MVVM frameworks that allowed them to manage copious amounts of code on the client side vs. middle tier. Cairngorm, PureMVC, Swiz, Parsely, and Robotlegs were born. Cairngorm is still around, but Swiz/Parsely get most of the play in the Flex world with PureMVC and Robotlegs hitting both Flash and Flex.

With exclusion of Cairngorm, all 3 have a lot in common. While everyone somehow manages to make their own implementation, learning one helps in learning another. Additionally, most never made it past a version 2, and even then most of the changes weren’t a dramatic workflow change.

JavaScript is nuts on the framework front. While the libraries themselves are great in that once you get over the burden of reviewing 5 of the same thing, the frameworks on the other hand are all over the map. Some are just query helpers with binding thrown in. Some are actually a certain group of existing libraries with a defined way of working with them, and thus named a framework… even though no code is actually associated with the framework itself. Worse is the versions can sometimes be drastically different. If few in #, this wouldn’t be a problem.

Worse, there are 100 times more people in the JavaScript community with their own opinions on what MVC means. What MVP means. What MVVM means. What the differences are between the 3. Their own descriptions for what the differences are between Passive View, Supervising Controller, and Presentation Model… and sometimes pretending (innocently) that the only thing that exists is MVC, period.

The other thing that is clear is that there are a variety of applications (not progressively enhanced websites) that are done with JavaScript, and thus each framework targets that particular version. For example, PureMVC and Robotlegs have Mediators which make it easier for the View (what you actually see) to change a lot during the project, yet still keep its ability to get it’s data without race conditions, and have it produce the necessary  user gestures through Events. Swiz on the other hand, had a Presentation Model injected into the View, and you had a nice API the View could call/get it’s data from. A lot of Swiz guys I talked to NEVER used the states features in Flex 4… nor saw the point. GUI changes didn’t affect PM API, they weren’t complex enough that you had to use mock interfaces for the PM’s to test View’s in isolation… so for this group, it worked well. In retrospect, this was a nice, natural evolution that happened.

I’m seeing the same thing in JavaScript, but it’s massively larger, and a lot of times you’re cherry picking either a specific feature of a specific library to be used with other ones, and you’re settling on a version. The last one is worrisome from a consulting perspective. When dealing with clients, Technical Architect/Directors want to ensure whatever framework you settle upon has good online documentation, you can hire people who know it, and it has a future. Using the same metrics I use to do so for frameworks in the Flash/Flex world is a little harder; just because its someones side science project doesn’t mean it’s not immensely useful, nor easy to learn.

The other challenge from a consulting perspective is leaving clients with work that they can support… or my firm would even want to get involved in. For example, there are copious reasons Ext JS 4 moved away from Object.prototype modifications. If you adopt a Ext JS 3 project from a client, you now adopt those problems even if you didn’t write it. With Flex projects, you eventually learned what problems there were from porting a Flex 2 app to 3, or what parts of mx were supported in Flex 4, and could find blog posts covering these challenges. With JavaScript, I’m finding a hard time finding commonality between the stacks that different companies are using.

I. Do. Not. Want… to be a non-Enterprise TA right now. Holy fish. Like, it’s 2008: “Yes, we’re using YUI version 2, it’s rad, has a large company backing it, and we can hire for it.” It’s 2012, and you’re either a jQuery, Sencha, or Dojo kid… oy vey.

So far, with the exception of Ext JS’s MVC implementation, it seems to have all of that solved in version 4 as best it can with the ability to have your own libraries added in with your own modified build process over theirs as well if you see fit to do so.

Video Codecs

No one has solved the codec problem yet. This is where HTML5 video just doesn’t work as advertised. I won’t go too much into this topic as for Enterprises, you’re usually more concerned about VOD, DRM, multicast and live streaming which Flash owns for desktop and HLS owns on iOS. More info about the WTF here and the OMG here.

I only bring it up because it’s just accepted in our world that video and compositing of it + assets is expected in our content, yet now… it’s not. Good designers can make it work, but the point here is from an integration perspective the cost of integrating that content.

Tooling

Lastly is tooling. While Aptana makes an attempt, it seems that Microsoft’s Visual Studio is the only IDE that seems to take web development seriously for those building large applications. Since me and a lot of people I know in Flex development use Mac’s, it seems our only alternative is JetBrain’s WebStorm. Granted, they have other flavors of their IntelliJ IDE,  but without commonly expected functionality like code hinting, intelli-sense, and re-factoring, it’s hard for use to take web development seriously.

There is a huge productivity cost that people seem to forget when you move from Eclipse/IntelliJ with those features to Notepad. When you have multiple developers, that time spent adds up, as does the lack of accuracy on your team’s velocity in solving issues.

In 2004, a lot of Java Developers tried out Flash. They then left. Adobe then created Flex. Some came. When Flex 2 came out, the runtime worked, the language worked, the components worked, but more importantly, the Eclipse IDE at the time… worked. The refactoring was, and still is not the best compared to IntelliJ and Visual Studio, but it’s enough for them to take it seriously. That’s when they came en masse, and peeps like Bruce Eckel were like, “Flex is good stuff”.

Going into an Enterprise and telling developers they are no longer allowed to work on Enterprise software with intelli-sense and code hinting isn’t going to work. Thankfully Ext JS is working with a few tools vendors, and some, like WebStorm, can be customized to improve the hints you get, including on your own code.

At the end of the day, we Flex Developers are concerned about the overall reduced project velocity & resolution prediction that comes with losing static typing (“What and where is the problem and when is it going to be resolved?”). For smaller projects with smaller teams, I guarantee you the point is moot. In doing both, if you CAN do both, dynamic languages are so much faster and fun to develop quickly, and flexibly in. For 18 month, multi-developer teams on code that’s alive for 5 years, it doesn’t.

Introduction

As a business owner, we have to meet the needs of those clients that have adopted the HTML Stack, or feel they need to and cannot be convinced otherwise. In the following article I’ll cover what Ext JS is from a Flex Developer’s perspective, why you should care, and some conclusions on how using it + Flex changes our business for the better.

As I mentioned before, the events of November 9th, 2011 shook the Flash & Flex world to the core, and I had 2 choices: figure out where to go, or let other key members of the community figure it out.

I chose the latter plan: play Skyrim and disappear for 3 months to let it all shake out. If things hadn’t been figured out by key members of the community, I’d just figure them out for myself. It’d also be around the same time as Groundhog Day: If the Flex community saw their shadow, and freaked out, I could come out and help them weather the longer winter.

It’s been 3 months and so far, it seems all the Flash Devs went jQuery/Backbone (or Angular) whilst the Flex Devs are debating between Dojo and Ext JS (pronounced “X Jay S” if you’re French Canadian) (yes, I tried YUI and left just as quickly). After talking with members of the community and doing some of my own research, it seems Ext JS is the right choice for the type of work I do. Like using Flash vs. Flex, it’s clear it may not be the right choice for you. If you’re a Flex Dev doing large, multi-developer projects, I’ll bet it IS the right choice. Read on.

What is Ext JS?

Ext JS is a component framework for building web applications atop JavaScript, HTML, and CSS. It’s made by a company called Sencha who also makes a mobile version called Sencha Touch.

It’s attractive to Flex Developers because:

  1. It has components. Lots of components.
  2. It has styling and theming features.
  3. It has a Model architecture built around data store & server CRUD operations.
  4. It has charting components that do not utilize Flash Player (for good and ill)
  5. It has awesome item renderers for grids.
  6. It has classes for JavaScript with inheritance.
  7. Layouts with Containers
  8. Standard Focus Manager
  9. Core Library with DOM helpers as well as JavaScript language extensions
  10. A big company, with investment, and tons of docs who’ve adopted a prescriptive MVC framework.

There’s a lot more, but that is what we Flex devs actually care about.

How’s it work?

Ext JS is a framework; a collection of classes, 3rd party technologies, and a prescribed methodology for building web applications. HTML is used to show the components. CSS is used to style and modify interactivity. JavaScript and declarative JSON is used tomake things appear and work.

JSON, traditionally used by Flash and Flex Developers for data transfer, is actually the main way you code Ext JS, similar to how MXML makes up most of your GUI in Flex. Since JSON itself can be written in a declarative way, this is usually the core of how you define a lot of your application; both GUI and data. This JSON + JavaScript is interpreted to create classes, components, and listen to event handlers. Internally, the Ext library will redraw the GUI as necessary, whether that’s modifying CSS styles on the DOM objects that visually represent them, or swapping out innerHTML wholesale.

You include a javascript library on your HTML page, code some boostrap JavaScript/JSON on the page, and voila, you have an Ext JS app. It can be as small as using 1 or 2 classes from the Ext JS library, to a full blown application that uses their components, their model classes, their MVC, their default module loader, their implied CSS abstraction layer, and their build system… up to you how much you want to use.

Prescription & 3rd Party Integration

Sencha has to walk a fine line with Ext. From an Enterprise stand point, they have to lay the ground work for a prescriptive way to utilize their technology. You need to make a framework easy to work with, have good documentation, and not be too flexible that developers can all go their own way. This allows larger organizations to hire/cross-train easier, have those developers actually be successful with minimal investment, and basically ensure any skillset “knows how to build an app”.

It’s a sales pitch, yes, but it does need to try to work like that. In reality it never does, hence consultants like me existing, but that’s not the point. You don’t want many different ways to skin a cat from an architecture perspective. It’s fine if you cuddle your brackets, use TextMate to code, and prefer Mercury over Git… it’s not fine if you prefer MVVM over MVC, want to be intimate with the DOM, and the other developers in another part of the company on a companion product don’t. Unlike Design Agencies, Enterprise companies do have to pay their Technical Debt. In fact, I’d argue they pay more than they should, compensating in a bizarre karma like way for Design Agencies who get away it. You want to mitigate this problem by making something easy to use, easy to hack, but prescriptive enough that if you don’t know any better, you won’t cause undue costs down the line in the way your team built something.

JavaScript, currently, is all about libraries, more so than Flex and Flash was for a variety of reasons. Namely abstracting browser differences, abstraction over new features with fallbacks, and the sheer number of developers from a variety of backgrounds. Each company is going to use different libraries merely based on the number of library choices out there. The same goes for internal projects. A lot of companies have their own internal libraries utilized on products for their business, whether B2C or B2B. You need to be able to integrate with these in your native language.

Sencha needs to support prescribed direction in how you build web applications with the ability to support 3rd party libraries.

There are a few things they’ve done to facilitate this. Here are a few that matter.

First, they’ve abandoned Object.prototype as of Ext JS 4. If you’re a Flash Developer, you’ll remember having your language suddenly act different because some developer or 3rd party library overwrote a core property/method in Flash, and suddenly your entire application worked differently… or it only did it sometimes because of later loaded class. Unless you knew what you were doing, these were nearly impossible to debug since the documentation stated a method did one thing, but clearly during testing did another. Even if you did know what you were doing, there aren’t many language, nor tooling facilities to help you debug this inheritance mixin whackness.

Considering JavaScript library inclusion amounts are significantly higher than say Flash or Flex, the risk of collisions are higher. On multi-person teams across an organization, with already strained communication this can be horrible to try to resolve.

Also, from a module perspective (those of you using PureMVC multi-core or many Robotlegs Contexts will get this), you need to sometimes run may applications in parallel on the same page. Not having to worry about stomping on someone’s method/properties is a nice feeling to have.

Second, they’ve commited to bootstrap.js their own bootstrap.js from a library/module perspective which supports both debug and production mode. With the build process, this allows you to develop with new classes on the fly, and in production mode actually have 1 file for you’re entire application. This is for speed & ease of development purposes.

We take this for granted in Flash/Flex where all our classes are included, and zlib compressed in a minified bytecode format into a single SWF file.

Remember, Day 1 of Flash Development had 1 SWF. As a binary format, everything you needed was right there for you, ready when you started. The HTML stack was different. Everything is a bunch of files all loaded at different times from different places. As a coder, you know this is a nightmare to figure out. From a networking perspective, initiating a lot of HTTP requests to the server and downloading them in parallel is also slower. So JavaScript has a habit of allowing you through build processes to put all of your classes into 1 massive file to help alleviate the race condition pain as well as improve performance, compression, etc. However, during development or when building modules/lazy loading, you still need the option to load on the fly.

Third, their MVC is prescriptive. I won’t get into too much detail because as a Swiz/Robotlegs aficionado and PassiveView h8tr, I already want to use my own or Angular… anything but theirs. That doesn’t matter, though, the point here is that they’ve provided the built in mechnisms, it works great with the framework, and they have documentation on it as such. This ensures organizations take them more seriously, have a chance to at least be forced into some known structure, and you as a consultant have a chance of understanding how they did things if you come onto an existing project (assuming they didn’t just use Ext JS for it’s query syntax and get all intimate with the DOM… which you can do if you wish).

That’s Great, Show Code

Here is some Hello World code:


	
		
		
		
		
			
	
	
	

As you can see right off the bat, closures are the word of the day. Ext JS is full of either closures (anonymous functions or variables that equal functions) and/or JSON. You’ll intermingle both a lot.

Components

Components are the main reason most Flex Developers dig Ext. Not only are there are a lot of components, but some of the ones they have are better than their Flex equivalents. And this, folks, is one of the reasons why software developers often tell you to try another language or platform, at least 1 per year. You’ll see what the competition has, and YOU’LL GET PISSED OFF!

Why didn’t Adobe build this level of components for Flex? Why does Django, Rails, Coccoa, and countless other frameworks have a Model with optional Facade on top to support offline storage with online CRUD syncing out of the box… and Flex does not? How come our DataGrid didn’t come with built-in paging?

Enough ranting, check them out yourself (scroll down, check out list on bottom left) while I cover a few here.

T3h Über Grid

You’ll notice right off the bat their DataGrid is pretty bad ass. Three things I want to point out about it.

Notice they have paging built-in. This is, in part, to their Model/Proxy/Store setup. In Flex, you had to code this yourself (don’t get me started on Blaze DS/LiveCycle).

 

Notice their filtering actually has a GUI with a drop down menu to customize (and which YOU can customize) on how to filter the data. No server trip needed. Hot.

And finally… “row editing”. Yes, an entire row can be modified. You can also allow a row to be edited, but only allow certain columns in that row to be edited, as well as customize this renderer. Awesome, right?

Charts

Charts, like Grids, play a central role in a lot of financial & insurance software. You see the data in lists and you visualize it in charts. Ext JS 3 used Flash, but now they use SVG (and I think VML in some cases) and no canvas. This ensures it’ll work without a plugin. The downside is you can’t print yet. They’re working on it, and there are a lot of server-side plugins where you can easily wire up the chart data to a button to have the server assemble a PNG or PDF for you to print so solutions do exist.

You’ll notice, too, that they are interactive. You can customize a lot of their display + tooltips I believe to degree using templates (I’ll go over that later). They also have the standard animation built in as well. From a sales perspective, these charts  + the grids demo very well.

While we at WASI have our own Dashboard, it’s nice to know you can accomplish the same style of application and product using Ext’s components to create Dashboards.

Everything Else

Everything else is what you’d expect your team would need from Tabs to layouts to forms. The layouts are a little tricky if you’re not a CSS/DOM savant, but again, they abstract a lot of that from you (including that weird IE vs. the rest of the world padding measurement insanity).

There are a lot of little innuendo features too that make a big overall difference like all windows having the capability of being resized with a resizer, from all sides.

The components all have the standard DOM interaction events usually abstracted away so you just add an event handler for it, and you can create your own as well.

Yes, they have drag and drop.

Yes, they have a variety of ways to handle state, both in components and within your application itself.

Their drawing package uses SVG I think… not really sure why they aren’t using Canvas, but I’m sure they have their reasons.

Localization & Accessibility

They have localization and accessibility built in. I had some concerns during the fast track course because it seems the localization requires the application to be totally reloaded just to have text changes take effect. Meaning, there aren’t default framework bindings to a resource manager like you do in Java or Flex.

Either this was a bug or we couldn’t figure it out, but bottom line the components built into Ext JS do work with it, and you can see their text match the language; we just couldn’t get this to work at runtime, only compile time which is fine.

Event Model

Just a quick note on the event model. In Flash Player, we have the standard ECMA event model in terms of capture, target, and bubble phase. Since IE is backwards from the rest of the world and is in the minority camp, Ext JS flips it around and gives you their own Event class as well.

They key difference, however, is that interaction burdens are put on developer, much like Corona SDK does in Lua. If you want to handle an event, you need to return true to ensure it doesn’t bubble up and get run. I’ve seen other frameworks which just code gen the event.stopImmediatePropagation() and event.preventDefault(), but not here… and sometimes you need to return true from event handlers vs. calling the event methods. I haven’t figured out yet where the consistency is.

Anyway, a small thing, but good that they abstract the browser differences for you and provide a common event class + mechanism for you. The addEventListener and/or callback way of doing things will be extremely familiar. I believe they have an event bus, but it’s not like Robotleg’s Actor or PureMVC’s Notification system.

Styling & Theming

If you know CSS, you know how to style and theme a Ext JS application. Yes, that’s it. I unfortunately didn’t get to see, nor play with, a lot of the skinning in the Fast Track, just styling. I’m not sure how much of the image issues in various browser they abstract away since you’re using your own CSS styles.

Ext provides some template theme CSS files for you that you can modify, both built in classes as well as Ext JS ones. Combined with SASS/Compass, this really makes things a lot easier to handle. If you’re not familiar with SASS, there are just 4 things you need to know:

  1. You write 1 CSS style, and it’ll generate the browser/vendor specific ones if any (1 line of SASS could be 3 lines of CSS)
  2. You can utilize variables in your SASS code which helps dynamically create the appropriate CSS (like determining width/height on the fly, etc).
  3. They actually treat it like css CLASSES… so all the inheritance feels like inheritance vs. some “I’m not really code, but I’ll pretend I know what OOP is”
  4. SASS files get generated through Ruby’s Compass into CSS files for your project. You don’t write CSS; you write SASS and Ruby’ll regen the CSS for you.

Models, Proxies, and Stores 

Most Flash and Flex projects I’ve worked on have some form of Value Objects (classes that hold data that represent a server-side entity with additional data the client needs), Models or Proxy classes that allow the client retain data and state, and service classes that form the basis of the CRUD operations with the server.

In branching out into other languages/frameworks/platforms, it’s clear most have a large sub-system and abstraction layer upon this setup. Django has Model, Rails has ActiveRecord (or did… been awhile), Coccoa has CoreData (amongst other things), and Java has all sorts of things. Even with the large influx of Java, Flex never really got that kind of abstraction unless you went with the full Blaze DS / LiveCycle stack. It was abstracted away enough that you could build both non-Blaze/non-LC apps and not know the difference, but the point is that it was clear Adobe didn’t think that was a core part of most apps, or rather that particular part could be monetized in Enterprise only offerings.

Whatever the reasons, it’s a core need in a lot of applications nowadays. I need to persist data in RAM, on the client cache (whether SQL or cookies), and with the server. Using a Facade or Proxy to make this part not only easier, but allow client side validation, as well as being built into all components, is a huge win.

All you need to know is it’s like an ArrayCollection that can save both locally to disk as well as sync with the back end as well as work as a dataProvider to all your components. And yes, when the dataProvider updates, Ext JS will update your GUI controls. Yup.

Sencha has specific meanings in the Ext world between Model, Proxy, and Store so don’t necessarely think design pattern as each is completely different than the other.

JavaScript and Core Classes

While Ext JS primary value to Flex Developers is their component framework and browser insanity abstraction, they also have a plethora of helper/utility classes for JavaScript, CSS, and the DOM as well. You can actually just use Ext just with the DOM using their DomHelper, DomQuery, and your own JS stack if you wish as their helper classes alone are nice to have. Some of it is open source, not sure.

You’ll notice they actually have a layer over top of low-level functions of JavaScript like apply, they have their own version of Delegate (yeah, remember that bullshit? LIVE IT LOVE IT SUCKAZ AND THANK STEVE JOBS FOR IT), as well as a rudimentary binding syntax.

They support inheritance and package names for your components. Although I’ve never done Ext JS 3, it’s clear they are constantly improving because the syntax in 3 was nasty compared to 4.

Templates

I’m still learning about the world that is HTML Templates but suffice to say there are 2 main uses in Ext JS.

The first is custom components. Creating custom components in Ext JS is pretty straightforward; you just extend Component or Container, similar to Flex. However, they’re creating the DOM for you. What if you want to create your own HTML elements based on some strange PSD/AI design comp the company Crayon Pusher sent you? You can create your own HTML and have the data actually bound into it through a similar binding syntax we’re used to.

The second is item renderers. Any type of list, whether a small Container, or an actual component within a DataGrid itemRenderer can use a template. This allows quick creation of an itemRenderer without having to write a lot of code if you want to. Pretty sick.

MVC, MVP, MVVM, Your Mom

I’m not going to go into their MVC too much. Suffice to say, they like the Passive View and have no qualms with a Controller managing multiple Views (at least, that’s what the Fast Track implied, but they don’t have time in those types of courses to show you all avenues). Worse, their naming scheme assumes you have a flat file structure, so you don’t name something “MyModel”, just “My” because they’ll append a name to it anyway causing it to be MyModelModel. That, and I fail to see how a flat directory structure of model, view, controller will scale to an application of any reasonable size, even with Ext ability to use string namespace aliases to refer to your classes.

Keep in mind the instructor was only given 1 day to show 1 way to do MVC, and we didn’t get too much time to dive hard core into the internals. It was clear, though, none of us liked it, and already Flex 1 era framework ideas were churning to bring our ideas (and biases) to Ext JS.

What Sucks

  1. Built on JavaScript, not CoffeeScript or Dart
  2. They have horrible naming conventions for optimization purposes that no longer matter in todays world.
  3. Tooling

The top of this post covers my major concerns about JavaScript for applications of this size. I’m not worried about performance, just team velocity compared to ActionScript. In my experiences with Lua and ActionScript 1, your velocity in the beginning tends to be faster, but you hit a plateau and the lack of strong-typing annihilates your teams velocity and ability to project accurately. Unit tests help, but are more of triage vs. a tool.

The naming conventions are bourne of an era no one should care about but they still do. We’re in a gray transition as browser makers bring the HTML Stack up to speed to build applications, so you can’t just full stop ignore all the lessons learned.

However, I’d argue, as would countless others, that code readability trumps performance concerns. This goes way beyond “premature optimization is the root of all evil”. On extremely large code bases, verbosity is a virtue. You want readable code that it is easy to understand, both for your team and for yourself.

Because of String lookup costs and the ability for JavaScript minifiers to only compress none-reserved words like “this”, countless techniques are used to obfuscate the code to compensate. That may have mattered back then, but it doesn’t matter now. Worse, though, is that the counter justification is that for larger code bases, you do in fact need to make every optimization you can which in turn I counter double fold:

  1. Readable code trumps performant code.
  2. If this is such a concern, why are we using this over Flex again?

More importantly, however, is for API development. API’s are given to people who you sometimes have no contact with, nor have any clue about their adeptness. Thus, you need to make it as easy and obvious as possible. For an Enterprise framework such as Ext JS, you’d think this would be top priority. It’s clear Ext JS has some highly experience web developers involved in developing the API. I respect their knowledge, but it’s time to change.

Examples include Ext.getCmp vs. Ext.getComponent, Ext.getEl vs. Ext.getElement, and baseCls vs. baseClass. It’s prevalent throughout the framework, and mixed in with good verbosity… which makes it worse.

Ext JS 4.5 clearly needs a name overhaul if they expect senior programmers to take it seriously. Considering it’s JavaScript with Ext JS’s alias support, you’d think this would be easier to do.

While Ext Designer completely blows away Adobe Catalyst, it still has some issues with regards to the code generated and code round trip/merging. While looking nice, the results are not always being correct. We had easily duplicatable issues where the code generated did not match what was in the IDE GUI. Still, an extremely useful tool for generating a lot of the needed visual component code.

Finally, the lack of out the box code IDE is a near deal killer, at least for strict TA’s we deal with at large organizations. I know Ted said they’re working on it. Without things like intellisense and code hinting, you’ll make it hard for people to take things seriously, as well as making it harder to learn for more traditional programmers who suddenly have none of their mature toolset available… like… Java Developers… who came to Flash… and left… and… then they created Flex Builder…

Critical Mass

It seems Sencha has all the hallmarks for success and reaching critical mass with Ext JS. This is the ONLY reason I and others have given them any attention. As previously mentioned, you need a mid-size company, with money, and a good product to have it adopted as a targetable platform for large organizations. Sencha seems to have all 3. That, and again their components are pretty cool.

As a consultant, their components, charts, Ext Designer, and website all demo nice as well making it easier to sell as an alternative to Flex.

Mobile Story

I won’t get into much here, but suffice it to say I’ve yet to see the mobile revolution impact our clients as much as it has impacted the Design Agency sphere. While both focused on consumers, for a lot of brands, smart phones and tablets are seen as a growth market, or the ONLY market, to reach certain demographics. All the statistics point to both the behavioral change of society using their devices to interact with the digital world vs. computers, yet those same statistics also who the desktop still being the leader in PRODUCING that content that the world consumes. Yet given that, the money doesn’t seem to be flowing in lock step.

As such, most initiatives have been “it’d be cool to blow some money on”, “we have to provide something for iOS, even if it’s crap”, and the most common “wait… this won’t make any money”. While I know there are a lot of device work going on out there, it’s just not in my consulting sphere, or if it is, it’s at a extremely low profitability area and thus not worth investing in.

For now, the same large interfaces that we make on desktops do not transfer at all to smart phones nor tablets. Just like how people started to taking their iPhone’s to work, and companies stopped installing company phones, and later with Macs so companies started offering Mac’s as well as PC’s… so too will this have to happen with tablets before large companies even have it on their radar as a focused set of initiatives.

Obviously this is dependent on industry type, but we’re just not seeing it in the financial/insurance area, only slightly in the media company area (which I might add are the only ones who seem to care about Android).

…but let’s pretend it DOES matter. Let’s say a Director wants to know your mobile portability story? What do you tell them?

With Flex it was pretty straightforward: 60% to 80% of your Service and Application Layer code could be ported, with no change, to have the same Flex desktop application work on iPhone, iPad, Playbook, and Android devices. The missing piece here, is the device’s web browser.

While I’m a huge/firm believe in a long term native future for devices, there are still many use cases when a consumer is in a hurry and hits a company’s website expecting it to work. Considering some Operators only allow some applications to be downloaded over Wifi vs. 3G, this makes the website more important since even 3G can act as Edge. If you’re a business traveller, regardless if you’re on AT&T or Verizon, you know exactly what I’m talking about.

2 key examples include Marriott.com and PapaJohns.com. I encourage you to play with both on your iPhone/Android’s web browser. You’ll notice they try to duplicate the native  look & feel paradigm. “It works like an app!”. Sometimes it works, sometimes it doesn’t. The responsiveness is the first thing you’ll notice that falls on it’s face. Apps just perform better, and consumers can tell. At least for now.

That’s not the point, though; notice how the functionality they need is forced to be simple because of the screen real estate being so small. There are a lot of use cases where even just a company mobile app is needed for its Desktop equivalent. Other times, you really do want to get as much information as possible from the user (a la Papa Johns). To me, Papa Johns is the perfect example of an application that an Enterprise would want on a phone, then they realize at the design/analyze phase/outset that most funtionality couldn’t be done, but shove in as much as they could anyway.

If you’re forced to comply, what do you do?

You use Sencha Touch.

Now the same story applies like it did in Flex with 1 key differnence: Using PhoneGap, you can now target everything. All devices including their web browser, all while sharing 60% to 80% of your Service and Application Layer code. In theory… I’ve heard a lot of negativity towards Sencha Touch v1, but apparently v2 is a lot better, haven’t investigated the code yet, just testing the components on devices.

Pretty cool, huh?

Conclusions

If you haven’t read João Saleiro’s article, and you’re a Flex Developer, I encourage you to do so. I’ve reached many of the same conclusions as he did. The comments also have a lot of good info as well. The most important being team velocity. Time is money. This isn’t important to just large companies, either.

There are a lot of things we can do better and faster in Flex for large scale applications. It doesn’t matter, however, for 2 reasons. First, while from a technical perspective Flex’ future is bright, from a marketing and business one it’s over. The next 5 years are the sunset. Like FORTRAN and Cobol, companies invested billions, and those applications that run parts of their business don’t magically disappear overnight. Second, even if we know it may be a better solution for some use cases (many objects like Visio, highly dynamic interactions w/many redraws, compositing images & video, etc), we’re ultimately beholden to what our clients want, even if we know what they need is different. Thus we have to do both: Flex and Ext JS.

Based on all of read and seen, next to Dojo, Ext JS is the best solution to utilize for HTML5 web application development if you are a Flex Developer dealing with large applications and teams. Their components, documentation, mobile story, company size, and growth show that they are close to reaching critical mass where it can be adopted by large companies as a viable product to use for things traditionally done by Flex. Additionally, a lot of what you already know carries over to Ext JS quite well. If you’re like me, you just need to freshen up on your DOM and CSS knowledge, and re-examine JavaScript with fresh eyes compared to the AJAX revolution bs of 7 years ago.

Furthermore, unlike other server-side solutions, Ext JS lends itself quite well to hybrid solutions with Flex being used for certain use cases and the HTML stack for others, all on the same project. You and/or your firm having the capability to provide both is immensely valuable. Utilizing Sencha Touch and PhoneGap, you now have multiple mobile options in your tool belt as well.

For the record, I still believe using Ext JS will take longer and have a harder to track velocity compared to using Flex. That said, I’m still diving into Ext JS with a positive attitude.

Good luck!

19 Responses

  1. Suketu Vyas

    Thanks Jesse good post… I am to on ExtJs

  2. Quite long but very interesting article.
    Someone on my blog mentionned the “viral” licence of Sencha ExtJS : GPLv3. More information here:
    http://www.sencha.com/products/extjs/license/
    If you are doing enterprise development, you might want to have a good look at these terms. It could turn Ext JS into a bad alternative.

    I don’t know much about the licence differences but apparently it seems very important if you want to keep your source code proprietary (which is the case for a lot of existing Flex apps I believe)

    Fabien

  3. Aditya Bansod

    Hi Fabien — to clarify, we offer Sencha frameworks under a dual license model. You have a choice to use it under GPLv3, or the Sencha Commercial License. The page that you link has both licenses listed there, and it’s your choice which you can use. It’s worth noting that the GPLv3 license is free (of course), and the Commercial License is paid for.

    Aditya
    Sencha Product Management

  4. Thanks Jesse,

    Awesome article, I actually saw the google ads for sencha and sort of showed it around here in the flash/j2ee shop. It looks cool, obviously real developers are kind of freaked out about AS1 style code and lack of strong typing is a developer nightmare. Hopefully the people at Sencha can develop the first IDE that actually shows errors in their JS classes as well as the ones written. They got money.

    I do think that Sencha need to develop some kind of back-end layer however, there are so many back-end frameworks it would be nice to see them integrate it in similar to how GWT does it. Id like to see a JSF 2/Stripes or Spring MVC hybrid integrated in with Sencha – that’d be pretty sick.

    Keep up the awesome articles, Ive been following you for like 8 years bro.

  5. Awesome post – I read it all :-)
    I was interested in Ext JS before reading it, but this has confirmed that I need to take a really close look. Onwards and upwards.

    Thanks Jesse.

    PS: I remember vividly your Robohelp (that’s what it was called, right?) preso on building AS2 components. You used Delegate, and at that time it was slick to do so! :-)

  6. molaro

    Great post! I read all of it!! This has by far made the most sense of we’re to go next for Flex devs after the Adobe debacle in November.

  7. Julien

    Very interesting post, I really like the level of detail you cover this article (dude you need to write a book). I’ve also been on the Flex to X. boat for several months, and the most complete framework I found was also Ext.
    I’m not saying I’d only restrict my “HTML stack” toolbox to Ext, since in small projects it wouldn’t really make sense, but in the large application we’re working on these last 4 months it would probably solve solutions.
    Cheers

  8. Great post Jesse – thanks! I remember working with a back-end coder who took 3 months to choose a platform – I just thought to myself, this is why I work alone – I could have done the back end in a weekend. Sigh. Platforms are good I suppose when you get enough usage out of them but can be a time sink if there are too many options. It is one of the nicer things about working with proprietary systems. Oh well – best of luck to the world – it always seems good to sway from one side to the other and back again – keeps things in check.

  9. Dimitar G.

    There is another framework which is quite easy to grasp from a Flex point of view – SmartClient:
    http://www.smartclient.com/product/smartclient.jsp

    In the long run though it seems Dart with ‘everything included’ could be a great choice.

    So after long months of battling with ExtJS and Smartclient (since they look great but are incredibly hard to grasp and kinda move in their own as long as there is an extensive need to peek under the hood), I moved entirely on Dart.

    It’s still a technical preview but language is right, editor is right, framework and included tools are amazing not to mention Dartium makes you feel right at home.

    Yet again, it’s a personal choice.

  10. […]  With most of tech giants joins the hands of Sencha (yea, it’s ExtJS), Ted Patrick (Joining Sencha), Yakov Fain (Starting blogging on javascript and ext js), Jesse Warden’s (Sencha’s ExtJS is viable technology choice for flex developers). […]

  11. Rick

    You threw a line in there about not being written in CoffeeScript. I’ve looked at that but found it just makes debugging harder. You talk about tooling vs notepad and thats how I feel about CoffeeScript, I want to debug my code not some generated code which I have to go back and find the line of my coffee code. This for me puts CoffeeScript in the “cute” bin.

    Am I missing something here?

    • @Rick I’m still learning too, but here’s what I know.

      First, you use CoffeeScript for 2 main reasons (many others, but here are the low hanging fruit).

      (1) for code maintainability. It provides language constructs for programmers who come from OOP languages. More info at Thomas’ blog if you’re interested. It also drastically reduces the code size when writing that OOP; notice how CoffeeScript, like Dart, has a lot of JavaScript outputted compared to the original file.

      (2) JavaScript has some serious issues with regards to puzzlers. I’m not sure if you’ve ever read any of the Java puzzlers, but here’s a good preso to see what I mean in regards to how CoffeeScript solves some of them. Combined with x-browser differences CoffeeScript can really help here.

      Second, Mozilla and the CoffeeScript crew at least are working on allowing native CoffeeScript to be debugged. We had the same problem with MXML in Flex (a high level language that compiles to ActionScript). Macromedia/Adobe had to find a way to allow line #’s to somehow carry over to the compiled ActionScript, so when you debugged, it knew where your breakpoint was in the original file.

  12. just to react on the “sit it out” choice you made: I am a Flex developer coming from Java, and I do quite a bit of php now too as I run amfPHP. Right now I’m sidestepping the problem by focusing on server work as much as possible.
    Like that I can just keep an eye on the client stuff and hopefully in a few months we’ll see some clearer trends. ExtJS sounds nice but it’s too early to invest in it, I find.
    Ariel

  13. Hi Jessie,

    I wondered why you did not mention “HaXe” http://www.haxe.org/? as have all the compiler features your use to such as

    – Strong typing
    – Type inference
    – Packages
    – Classes
    – Interfaces
    – Generics
    – Enums
    – Iterators
    – Inlining
    – Macros

    And can use a wide range of IDE’s? including JetBrains intelliJ, FDT, Sublime & FlashDevelop. Also there are a number of projects targeting JavaScript library’s with HaXe including Ext.JS http://www.haxejs.org

    Here a quick link to the externs to Ext.JS https://github.com/jasononeil/Ext-JS-4.0-externs-for-Haxe or you can simply write your own.. Just a suggest when looking at doing enterprise level applications in JavaScript.

    Be interesting to have your take on it..

    James

    • For Flash Devs, sure. For Enterprise/mid-size companies willing to invest their future projects that have long lifetimes and expensive upkeeps? No. For that, you need a company with at least a verified future of 3 years or more (obviously 10). Haxe is open source, and doesn’t have a commercial entity behind it. As soon as they get Accenture or Deloitte using it, then my “No” changes to a “Yes”.

      • haXe does have a commercial entity behind it, just not a large one: http://motion-twin.com/

        BTW saw the ExtJS presentation. I’d rather take the gas pipe.

  14. Mark

    Spent last year doing flex and the last two months doing ext-js. The last two months of my life have been horrible. Ext JS is full of bugs (im using 4.07) and the documentation is abysmal. Javascript is a flawed language (just because a language has closures doesnt make it any good). Im not a hater – this is an honest perspective from someone who has used both, i’m sure you’ll find out for yourselves soon enough.

    • I hear you Mark and understand (no seriously, I do, hehe). Hang in there, brudda.

  15. […] Flex has a future but within a limited scope. I won’t sum up all my thoughts here, since Jesse Warden has already thoroughly written down the whole situation, which reflects my point of view quite […]