Reusability and the DOM
Aug/081
I consider my PHP to be well-written and at least somewhat re-useable (as much as any code can be), but my javascript? Not so much.
Is it because I haven’t chosen sides in the framework wars? (dojo, jquery, prototype, yui…) Is it because javascript has evolved beyond it’s display-logic roots into a “full-service language”, without also having it’s documentation mature? Is it because so many ‘designers’ don’t know how or why the id & name of form fields can be different?
Maybe it is due to the hooks provided by the DOM? Each page can have hundreds of unique hooks, and you need to go into the project with a sense of structure & organization, otherwise you’ll be including 20 javascript libs on each pageload.
And what about decoupling? I see people selecting elements based on their classes all the time. I think that’s ok if the class is structural in nature, but is it right to select on presentational classes?
Maybe it’s about standardizing the mapping between the database, the HTML, the CSS, and javascript, so that there’s consistency, predictability,reliability, and the potential for a whole lot of process streamlining via frameworks & integrated development environments.
Or does something like this already exist? Have I missed the boat?
Leave a comment
No trackbacks yet.

3:50 pm on August 22nd, 2008
Don’t worry, my JavaScript sucks too
The standardization you speak of will never happen.