Out of the blue, I got a recruiting phone call from a member of the Yahoo! Internet Application team. Not being in a position to accept a job in California, I politely explained my situation and thanked them for the call. We did, however, spend a quite a while discussing the state of web application development, present and future. Particularly, what enterprise employers such as Yahoo are doing to make robust and maintainable applications in the face of horrendous browser compatibility problems. The conversation affirmed a lot of what I believe, but also provided some interesting context from an enterprise perspective.
Here is the story: As web applications have begun to move critical and complex functionality to the browser client, there have emerged a number of problems born out of inconsistent and incomplete JavaScript implementations. No matter how much we complain, browser problems (yes, IE6 is a disaster), incomplete programming languages (yes, inheritance in JavaScript is hard), and poorly interpreted standards (box model, anyone?), are facts of life. Accept this. Move on. What can be done to to make the web a feasible platform for these rich user experience applications? Yahoo and I both agree, the basic idea is simple:
good abstraction.
Yahoo supports this with their YUI toolkit. But it’s also what Dojo, Prototype, jQuery, Google Web Toolkit and a number of other emerging libraries attempt to create. The model is:
+------------+
| UI/Ajax | < --- where I like to live
+------------+
| JS Library | < --- the *hopefully*
+------------+ impenetrable barrier
|Browser Hell| < --- maintained by only
+------------+ the bravest programmers
In this model, all JavaScript implementation such as User Interface components, AJAX connections, form validation, and DHTML manipulation, happens only through the support of the JavaScript Library calls provided by a library. It is up to the developers of the library to ensure these calls work as per the API specification (which certainly is no enviable task). Writing this way buys you three major advantages
- You only write your functionality once and it works for all browsers.
- You gain a lot of high level language concepts, such as inheritance
- You don’t have to re-write anything when new browsers are released
These are mouthwatering concepts for any seasoned web application developer who has tried write a web application without a 3rd party framework underneath them. That experience teaches you that you have to write your application 3 times (once for FireFox, half a time for Safari, and a time and a half for Internet Explorer). Then when a new browser comes out, you have to write your application yet again to support it. But when you are using something like the YUI toolkit, you can rely on statements like the following (taken from their browser support page):
…it’s important to be aware of forthcoming releases, especially from established brands that enjoy rapid adoption once generally available (GA). We are currently watching the development progress of Firefox 3 and Internet Explorer 8.
I personally would much rather let the crack-shot browser support team at Yahoo fix my web application for Internet Explorer 8 than do it myself. Once all the specified API in YUI works in IE8, it’s as simple as upgrading the library and my web application will work on that browser.
So what’s the catch? I believe the biggest inhibitor for companies and entrepreneurs in adopting this model is a brain scarcity issue. Supporting these libraries means that web applications need to be written by engineers. JavaScript can be simple by just defining global functions and copy-and pasting other people’s solutions from Google. But using these frameworks above requires the ability to apply concepts of software engineering. Object Oriented structure, proper use of design patterns, modularity, encapsulation. All the things that have lived in the hearts and minds of software engineers since the mainframes of the 60’s are now being applied to web applications. Historically, JavaScript has received the stereotype of being an easy language for non-programmers. Due to the “we know what you probably mean” attitude that browsers take towards poor JavaScript and markup, the average web contributors do not need to be engineers. They are writers, designers, kids, get-rich-quick schemers, and opinionated bloggers. This makes for a lot of diverse content, but not necessarily robust web sites. What is emerging now is the distinction between what technologies are used and how a technology is being used. It came to me straight from the horse’s mouth: enterprise employers are looking for web application developers who are well versed in good engineering and software design. It’s time to pony up and learn some design patterns.
So what’s my advice if you are an aspiring web application developer? Stop reading how to create a ActiveXObject(”Microsoft.XMLHTTP”) in IE6 and instead learn how to implement a Singleton pattern using Prototype. Unless you want to be on that bottom layer of abstraction, overrun when IE8 drops, it’s in your best interest to become familiar with writing code on top of a these new libraries. As I enumerated above, it is also much more convenient and practical to do so. The expiration date on your application will be a lot longer then “June 2008″ if you hitch your wagon to the strong minds behind these abstraction layers. If you are worried about becoming becoming dependent on someone else’s support team, rest assured there are a lot industrial quality web applications built on top of these technologies. It is a safe bet they will stand the test of time.