SUMMARY
As JavaScript development has matured, best practices have emerged. What once was considered a hobby is now a legitimate profession and, as such, has experienced the type of research into maintainability, performance, and deployment traditionally done for other programming languages.
Maintainability in JavaScript has to do partially with the following code conventions:
- Code conventions from other languages may be used to determine when to comment and how to indent, but JavaScript requires some special conventions to make up for the loosely typed nature of the language.
- Because JavaScript must coexist with HTML and CSS, it's also important to let each wholly define its purpose: JavaScript should define behavior, HTML should define content, and CSS should define appearance.
- Any mixing of these responsibilities can lead to difficult-to-debug errors and maintenance issues.
As the amount of JavaScript has increased in web applications, performance has become more important. Therefore...