Proliferation of Javascript libraries and bad start to the year

Ah, good old O'Reilly Rhino
Ah, good old O’Reilly Rhino

As a front-end developer, I can’t help but notice all the innovation going on. Especially compared to the backend, I feel that front end technologies these days are developing at quite a rapid pace. In particular, the areas of HTML, CSS and JavaScript.

HTML5 has of course been the hot technology as of late, which I regret not using more HTML5, because my company has to support legacy browsers like IE6/7 (which of course cannot support HTML5).
“But Tong, why don’t you use Modernizr or another shim to take advantage of graceful degradation?”
Well, the fact is that we are lazy, so we don’t want to rewrite a lot of our code for graceful degradation / progressive enhancement. And I’ve also noticed new templating technologies such as HAML, Jinja, JST, Mustache, and Handlebars, which uses JS to compile Handlebars templates, which itself is built on top of Mustache.

Another area is CSS. Of course my company can’t use CSS3 for much of the same reason as HTML5; support for legacy browsers. Take note that like HTML5, CSS3 is continually expanding and browser support is very inconsistent (so just look to W3C for guidance for now). However, there is also much innovation in the realm of styling as well. There’s LESS, which extends CSS with variables, mixins, operations and functions, much like a scripting language, and SASS, which adds much of the same things. Then we have frameworks that build on top of LESS/SASS, like Compass.
Notice how alot of new technologies are themselves improved or extended by even newer technologies, and so forth.

Nowhere is this more evident than in JavaScript. A little bit of history: Netscape originally developed JavaScript to be a lightweight interpreted language for amateurs (ie. users of VB). They named it JavaScript to take advantage of Java’s popularity, not that the two languages share anything in common. It was very popular, and because Microsoft had their own standards of the language, it wasn’t standardized until the late 90s into ECMAScript. In the late 90s/early 2000s, JS was mainly used for light scripting events such as submitting forms, animating icons, etc. It wasn’t until DHTML and AJAX came about that JS really started to take off, especially with professional programmers.

Hence, where we are at now. Ajax took off, and JS libraries (some may say polyfills) came out that significantly expanded JS’s use in everyday browser scripting. My company uses Prototype.js and Scriptaculous for UI. And certainly there were other popular libraries at the time like MooTools, and widget libraries like Dojo and YUI.

But the most popular JS library that came out in 2006 that really started web 2.0 computing was jQuery. Every web developer knows it, and 91% of websites probably use it. Jquery made ajax applications and dynamic application scripting as easy as cake. Hence my point now is that 90% of libraries today is built on top of, using, or extending jquery. It’s so ubiquitous. Want some boilerplate for your code? Bootstrap uses it. Want to add some structure to your single page app? Backbone.js uses it. How about mobile? Well jQuery mobile has got you covered. And jQueryUI has most of your UI needs down. jQuery has become a foundation of modern JS frameworks and libraries.

And now you can pretty much build your entire app, full stack, using only JavaScript. Rails developers can be more productive using CoffeeScript and Batman.js. BackboneJS, AngularJS and EmberJS have got you covered on your client side MVC needs. Need a utility library without Prototype.js’s namespace interference and object pollution? UnderscoreJS is there (while also being a dependency for Backbone). Modular JS components? RequireJS is there. Making vector graphics? Sure, RaphaelJS is there. UI widgets? How about Google Closure, jQueryUI, ExtJS, or the aforementioned YUI? Maps? Yup, LeafletJS handles that. Need just CSS selectors? SizzleJS does that. What about media overlays? Yes we have both ShadowboxJS and LightboxJS on each side of the force. In fact you can even build server side JS using NodeJS and SocketIO, as well as frameworks building on top of those, like ExpressJS. Mobile browsers? How about ZeptoJS, Dojo Mobile, or the aforementioned jQuery mobile? Or how about giving me a full stack framework like Meteor? And yes, JS can even compile templates on the client side without being horrible slow using Handlebars and JST. Unit testing frameworks similar to server side programming languages have appeared for JS, such as Qunit and Jasmine, themselves written in JS. And yes, there’s even JS Dependency Injection.

All this to show that, there are way too many JS libraries out there. Not that its a bad thing, but it seems to have exploded recently. Backbone.js wasn’t released that long ago, and there’s already extensions like Backpack.js and MarionetteJS built on top of Backbone, which itself is built on top of jQuery, which itself is written in native JS. My concern is that modern front end devs are forgetting the important foundations of JavaScript and the native JS API, when they are using all these libraries which seem too magical and obfuscate how JS works. We used to DOM-script, now we have two way data bindings, which do updating and ajax calls for you. Soon, front end devs won’t even know what an ActiveX object is, or how to handle IE specific bugs, because its all done in the background. And its all happening a bit fast… what might be the hot library of today might be the legacy library of tomorrow… my company experienced this first hand using prototype.js… which at the time was as popular as jquery but now is used by less and less websites. This makes it all difficult for front-end devs to absorb, which libraries are considered the front-runners and will be viable in the future. Who knows? It’s a concern I have…

HTML validation
Thanks to my friend Chris (the Polish juggernaut) for this tip:
[Unix commands] use xmllint –html *.html to check if your html document is well formed, but use tidy *.html for full on HTML validation. Little known unix commands, but useful.

Other news
And in other news, I’ve been having a terrible year so far, compared to last year. So far, in just January alone, I had:

-At the very start of the year, the power on my Mac went out and all the pictures I took in San Diego on the Mac guest account were deleted and cannot be recovered (this is a “feature” of unix guest accounts and works differently than windows guest accounts).
-alot of my good Korean friends went back to Korea.
-lost 6k in stock market options (each time the market went the other direction – go figure)
-pay $1340 in parking fines and traffic fines (because I had high beams on? geez)
-had to come in late for work or missing from work many times due to the stress of my new apartment, mortgage loans, escrow, new bank, etc.
-Didn’t get internet for two weeks due to no cable wiring
-Didn’t have electricity in the living room for two weeks due to faulty circuit breaker.
-Toilet cannot flush – now have to use the lobby restroom until a repairman fixes it.
-washer and dryer doesn’t work – all my clothes come out smelly and unwashed
-After doing tax returns, found out I owe the government $2600 in taxes.. ugh…

So yeah. In one month, I had more bad news that all of last year. Happy year of the snake.





7 responses to “Proliferation of Javascript libraries and bad start to the year”

  1. Cat Avatar

    Bleh, it’s frustrating to still support legacy browsers. Fortunately, we dropped IE6, but we’re still supporting IE7. I’m really hoping we can drop it soon. We do use Modernizr though, so that’s nice that we don’t have to use IE hack files anymore.

    We actually use CSS3. Some things like rounded corners don’t matter so much if a browser doesn’t support it. Other things like gradients, we have to put in other styles for IE. We’ve been moving to using SASS, which is nice.

    I like how many Javascript libraries there are now, since it makes Javascript less painful to deal with, but it does make it confusing on what to use. We used to use Prototype and Scriptaculous but have moved towards jQuery. Well, we’re still trying to phase out Prototype, but all new things are written with jQuery.

    Sorry to hear about all the bad things that have happened so far though 🙁 I would be so heartbroken if I lost photos. I’m always paranoid about stuff like that and try to make back-ups on externals. $860 is also a ridiculous amount for parking/traffic fines! I hope things will start getting better for you!

  2. Jea Avatar

    Wow. I must be living under a rock. I didn’t know HTML5 was out already until now! I looked up the new tags and for me, they’re useless unless customised by CSS3 codes. X3

    Password: 72#<RKPU4m3*i!o

  3. Tong Zou Avatar

    Indeed. Most of HTML5 is deprecating old tags, and making new tags more semantic like. They also allow for more interactivity via audio , video and canvas tags. Support for SVG is cool. But having data-roles is definitely useful. This is used to store metadata (for JS use) which before we had to use hidden inputs or class names to do. Definitely worthwhile.

  4. Winnie Avatar

    Eeep, I don’t really understand any of this but I just wanted to say thanks for the CNY wishes and hope you had a great one too!

  5. Stephanie Avatar

    I certainly hope that your year comes to a better middle and end after the bad start so far! You’ll have new friends and the stock market is pretty unpredictable, so there’s no telling when the money will come and go. Speaking of which, have you heard of Markowitz portfolio optimization? It’s only tangentially related to this post, but given past data, it minimizes risk given a minimum expected return. Just figured that you’d be interested. And most of all, I hope that your toilet flushes again soon! Simple things like that seem to cause people the most amount of trouble.

    According to the W3C pages on browser usage, it looks like the market for IE7 was in a steady decline for most of 2012! Perhaps in a year, your company will get to start using HTML5 and CSS3. By the way, thanks for telling me about the Unix command. That one is indeed useful!

    A while ago, my boyfriend commented that few man-made things are more complex than software: in no other fields do you build tools with tools that are built on top of other tools, and so on and so forth. And because of that, I hope that most of those JavaScript libraries are niche libraries: they don’t have a large following, so JavaScript programming can be kept mostly consistent, even though the standard JavaScript language by itself is already a mess. And to top it all off, using a combination of “magic tools”, my boyfriend actually got Python to segfault. (And he is very anti-magic now.)

  6. crochet afghan pattern Avatar

    Hi terrific website! Does running a blog similar to this require a
    large amount of work? I have no knowledge of coding but I had been hoping to start my own blog soon.
    Anyway, should you have any suggestions or tips for new blog owners please share.
    I understand this is off subject nevertheless I just had to ask.

  7. Avatar

    I like to share knowledge that I have accumulated with the year
    to help enhance group efficiency.

    Look into my homepage 清潔公司 (

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.