Test your code
After building good object-oriented basic code, the second aspect of developing professional-quality JavaScript code is to ensure a strong code testing environment. The necessity of strict debugging is particularly prominent when developing code that is frequently used or will be maintained by other developers. Providing a solid testing foundation for other developers is the key to maintaining code development activities.
In Chapter 4, you will see some different tools that can be used to form a good test/use framework, as well as simple debugging of complex applications. Firebug, a plug-in for Firefox, is one of these examples. Firebug provides many useful tools such as error console, HTTP request logging, debugging, and element viewing. Figure 1-1 shows the live screenshot of Firebug when debugging a piece of code.
Figure 1-1. Screenshot of Firefox Firebug plug-in running
The importance of developing clean, testable code cannot be overstated. Once you start developing some clean object-oriented code and combining them with the right test suite, I believe you will tend to agree with this.