Maintainable JavaScript


Book Description:

You may have definite ideas about writing code when working alone, but team development requires that everyone use the same approach. With the JavaScript practices in this book—including code style, programming tips, and automation—you’ll learn how to write maintainable code that other team members can easily understand, adapt, and extend.

Author Nicholas Zakas assembled this collection of best practices as a front-end tech leader at Yahoo!, after completing his own journey from solo hacker to team player. He also includes rules recommended by other industry authorities. Use these tips and techniques to help your team set aside individual preferences and function at a higher level.

Establish specific code conventions for your team
Use tools such as JSLint and JSHint to keep your team on track
Adopt style guidelines, such as basic formatting, to help your team produce uniform code
Apply several programming practices to solve problems and improve code quality
Create an automated JavaScript build system using a variety of utilities
Integrate browser-based JavaScript testing with tools such as the YUI Test Selenium Driver

Table of Contents
Part I: Style Guidelines
Chapter 1. Basic Formatting
Chapter 2. Comments
Chapter 3. Statements and Expressions
Chapter 4. Variables, Functions, and Operators

Part II: Programming Practices
Chapter 5. Loose Coupling of UI Layers
Chapter 6. Avoid Globals
Chapter 7. Event Handling
Chapter 8. Avoid Null Comparisons
Chapter 9. Separate Configuration Data from Code
Chapter 10. Throw Your Own Errors
Chapter 11. Don’t Modify Objects You Don’t Own
Chapter 12. Browser Detection

Part III: Automation
Chapter 13. File and Directory Structure
Chapter 14. Ant
Chapter 15. Validation
Chapter 16. Concatenation and Baking
Chapter 17. Minification and Compression
Chapter 18. Documentation
Chapter 19. Automated Testing
Chapter 20. Putting It Together

Appendix A. JavaScript Style Guide
Appendix B. JavaScript Tools
Book Details

Paperback: 242 pages
Publisher: O’Reilly Media (May 2012)
Language: English
ISBN-10: 1449327680
ISBN-13: 978-1449327682

0 0 投票数
0 评论