clearly not enough, where do you stop though...

I hear you! You do have to draw a line eventually, and it's often irritating to spend 20 hrs on tests and 20 hrs on the actual code.

But my question was not intended to get me hit with the testing stick,

Sorry :( I'm a bit ticked off at some who aren't allowing me to write tests at work due to time budgets so I'm quick to sling it around. Forgive me.

The question was more about how could we flag up JS bound HTML elements during the development process


I do a project search (textmate) for the string. I know that sounds overly simplistic but it has kept me from breaking things too often to count.

This doesn't solve any of your legacy code problems but I've gotten our crew so hooked on mootools that all of our js logic is tucked away nicely in classes, the only time there's a string for an element's id in our js is when we construct the objects, so it's a pretty easy thing to check / fix.

I've even started making a class to control the whole page and stick all the selectors in a property of the class:

var App = new Class({

  selectors: {
    nav: 'top-nav',
    header: 'header',
    awesomes: 'li.awesome'
  },

  // other code

});

So it's as easy as just checking where the main app was constructed.

Ryan Florence
http://ryanflorence.com

Reply via email to