Team LiB
Previous Section Next Section

Summary

JavaScript errors come in many flavors, from simple syntax errors to intermittent errors related to download or even semantic errors that produce results unintended by the programmer. To catch errors, JavaScript programmers employ typical debugging techniques such as turning on error messages and outputting verbose status information to track down logical errors, but a better approach is to use a program designed specifically for the task, a debugger.

Like other programmers, JavaScript professionals should always assume errors will occur and employ defensive programming to address them. Code hiding, exception handling, and simple ideas like the <<noscript>> tag should be part of every JavaScript developer’s arsenal. Yet all the while that JavaScript programmers try to employ good coding practices to improve the quality and maintainability of their code, they may find these practices often fly in the face of performance and security. Tools to “crunch” code to improve download or to obfuscate source to protect from casual snoops are certainly a good idea for complex scripts, but developers need to remember that the determined thief can thwart just about any effort they make. As JavaScript matures, certainly programming practices will as well.


Team LiB
Previous Section Next Section