Adding best practices to an application’s technical requirements speeds development, decreases the application’s total cost of ownership, and makes application code more easily reusable — which allows value created by the code to spread across an entire organization (instead of chaining value to a specific project).
Separate Behavior from Content and Presentation
Provide progressive enhancement
Code for flexibility
Alter content as little as possible
Document output, parameters, and dependencies
If the behavior changes an elements class or id, document this in the script. Likewise, if the behavior changes the content or outputs additional content, document what the output will look like.
Open source development very obviously benefits from applying these best practices. By creating flexible, customizable, and reusable code, open source initiatives increase the likelihood their projects will be widely adopted.