New JSMag out today

categories: javascript

The second issue of the new JSMag is out today, and among other excellent content, it includes an article from me about using object literals to organize your JavaScript features. Some good stuff for people who may be accustomed to writing more procedural jQuery. Here's the setup:

In the past few years, JavaScript libraries have given beginning developers the ability to add elaborate interactions to their sites. Some, like jQuery, have a syntax so simple that people with zero programming experience can quickly add bells and whistles to their pages.

Adding all those bells and whistles, even some pretty elaborate ones, seems to be just a few Google searches away. A copy here, a paste there, a plugin or a few dozen lines of custom code — the client is duly impressed, and you’re adding jQuery to your resume.

But wait. Now the requirements have changed. Now the thing that needed to work for three elements needs to work for ten. Now your code needs to be reused for a slightly different application where all the IDs are different.

We’ve all seen the snippets that make jQuery (and other libraries) look dead-simple. What those snippets leave out — and hey, they’re just snippets, right? — is how to design your code when your needs go beyond dropping in a plugin or doing some show() and hide().

The magazine is a paid PDF download ($4.99/issue), and with great articles on JavaScript profiling and JazzRecord for JavaScript databases, plus community news and an in-depth interview with members of IBM's Dojo team, I promise it's worth it. Do check it out.

Comment