Boekdetails
Formaat
Paperback
Pagina's
260
Taal
Engels
Gepubliceerd
Jul 14, 2012
Uitgever
Shroff/O'Reilly
ISBN-10
9350237954
ISBN-13
9789350237953
Beschrijving
About the Book: Maintainable JavaScript 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 Contents: Style Guidelines Chapter 1 Basic Formatting Indentation Levels Statement Termination Line Length Line Breaking Blank Lines Naming Literal Values Chapter 2 Comments Single-Line Comments Multiline Comments Using Comments Documentation Comments Chapter 3 Statements and Expressions Brace Alignment Block Statement Spacing The switch Statement The with Statement The for Loop The for-in Loop Chapter 4 Variables, Functions, and Operators Variable Declarations Function Declarations Function Call Spacing Immediate Function Invocation Equality eval() Primitive Wrapper Types Programming Practices Chapter 5 Loose Coupling of UI Layers What Is Loose Coupling? Keep JavaScript Out of CSS Keep CSS Out of JavaScript Keep JavaScript Out of HTML Keep HTML Out of JavaScript Chapter 6 Avoid Globals The Problems with Globa