Maintainable JavaScript and over one million other books are available for Amazon Kindle. Learn more



or
Sign in to turn on 1-Click ordering
Sell Us Your Item
For a $3.80 Gift Card
Trade in
More Buying Choices
Have one to sell? Sell yours here
Start reading Maintainable JavaScript on your Kindle in under a minute.

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.
Sorry, this item is not available in
Image not available for
Color:
Image not available

To view this video download Flash Player

 

Maintainable JavaScript [Paperback]

Nicholas C. Zakas
4.3 out of 5 stars  See all reviews (12 customer reviews)

List Price: $34.99
Price: $19.98 & FREE Shipping on orders over $25. Details
You Save: $15.01 (43%)
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
In Stock.
Ships from and sold by Amazon.com. Gift-wrap available.
Want it Tuesday, May 21? Choose One-Day Shipping at checkout. Details

Formats

Amazon Price New from Used from
Kindle Edition $15.39  
Paperback $19.98  
Shop the new tech.book(store)
New! Introducing the tech.book(store), a hub for Software Developers and Architects, Networking Administrators, TPMs, and other technology professionals to find highly-rated and highly-relevant career resources. Shop books on programming and big data, or read this week's blog posts by authors and thought-leaders in the tech industry. > Shop now

Book Description

May 31, 2012

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 will 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

Frequently Bought Together

Maintainable JavaScript + JavaScript Patterns + JavaScript: The Good Parts
Price for all three: $56.70

Buy the selected items together


Editorial Reviews

About the Author

Nicholas C. Zakas is a front-end consultant, author, and speaker. He worked at Yahoo! for almost five years, where he was front-end tech lead for the Yahoo! homepage and a contributor to the YUI library. He is the author of Professional JavaScript for Web Developers (Wrox, 2012), Professional Ajax (Wrox, 2007), and High Performance JavaScript (O’Reilly, 2010). Nicholas is a strong advocate for development best practices including progressive enhancement, accessibility, performance, scalability, and maintainability. He blogs regularly at http://www.nczonline.net/ and can be found on Twitter via @slicknet.


Product Details

  • Paperback: 242 pages
  • Publisher: O'Reilly Media (May 31, 2012)
  • Language: English
  • ISBN-10: 1449327680
  • ISBN-13: 978-1449327682
  • Product Dimensions: 7 x 0.6 x 9.2 inches
  • Shipping Weight: 14.1 ounces (View shipping rates and policies)
  • Average Customer Review: 4.3 out of 5 stars  See all reviews (12 customer reviews)
  • Amazon Best Sellers Rank: #32,154 in Books (See Top 100 in Books)

More About the Author

Nicholas C. Zakas is a front-end consultant who specializes in user interface design and implementation for web applications using JavaScript, Dynamic HTML, CSS, XML, and XSLT. Has has 15 years of web development experience and spent nearly five years at Yahoo! in various roles, including principal front end engineer for the Yahoo! homepage and contributor to the Yahoo! User Interface (YUI) library, having written the Cookie Utility, Profiler, and YUI Test.

Nicholas is the author of Professional JavaScript for Web Developers and High Performance JavaScript, a co-author on Professional Ajax, and a contributor to Even Faster Web Sites. He has also written for several online sites such as WebReference, Sitepoint, the YUI Blog, A List Apart, and the Web Performance Advent Calendar.

Nicholas regularly gives talks about web development, JavaScript, and best practices. He has given talks at companies such as Yahoo!, LinkedIn, Google, Netflix, TripAdvisor, and NASA, and conferences such as the Ajax Experience, the Rich Web Experience, OSCON, WebDirections, Fronteers, and Velocity.

Through his writing and speaking, Nicholas seeks to teach others the valuable lessons he's learned while working on some of the most popular and demanding web applications in the world. He firmly believes that no difficult problem should need to be solved more than once.

Customer Reviews

One of the modern techniques the book includes is a discussion about templates. Jamund Ferguson  |  4 reviewers made a similar statement
I usually keep this book open in .pdf format for quick reference when I need it. kevinw  |  3 reviewers made a similar statement
The book is written in a very simple language that is easy to understand and follow. Manju  |  3 reviewers made a similar statement
Most Helpful Customer Reviews
28 of 28 people found the following review helpful
Format:Paperback
"Maintainable JavaScript" by Nicholas Zakas (O'Reilly 2012) is a short-and-sweet little text on (as the cover says) "writing readable code". And by "readable code", Zakas means "code that other developers not named [YOUR NAME] will be able to read and make sense of and ultimately maintain". It goes beyond maintainable and readable code though--Zakas takes us on a tour of how to deliver high-quality JavaScript that is testable and maximally performant in production. If you look at Zakas' catalog, this subject is right in his wheelhouse, and the book reads like either a sequel to his 2010 "High Performance JavaScript (Build Faster Web Application Interfaces)" or else as an expanded version of Chapter 24 of his 2012 "Professional JavaScript for Web Developers" (3rd edition, and still my favorite JS text). It's an opinionated book about formatting style, about programming conventions, and about ways of helping you (and your team) write code that is a lot less likely to blow up on you down the line.

Right off the bat: the target audience for this book is not advanced JavaScript developers. If you are an advanced JavaScript developer (or even many mid-level JS devs) then these are concepts that you are already familiar with. You've already dabbled in a style guide. You already know to minimize global variables. You already know to use feature detection. And there's a good chance you're *at least* linting, if not testing, if not doing both of those things *automatically* as part of your build. If that sounds like you, then you might want to take a pass. But before you do, give the table of contents a second glance. (If nothing else, you'll feel really validated.)

So who *is* it for? It's for novice and intermediate level JavaScript developers that want to get a better sense of what "readable" and "maintainable" code looks like. It's for folks that are plowing through the other "slim" JavaScript books in the O'Reilly catalog (e.g., "JavaScript: The Good Parts", or "JavaScript Patterns"). It's for technical managers who don't have a JavaScript background. It's for folks that want to start a book club for front-end devs and have spirited debates about ASI and how many spaces to indent when an expression continues on the next line.

As I worked through Part I ("Style Guidelines"), my initial impression was that Zakas was writing a how-to for writing JavaScript style guides. We have 44 pages of in-depth discussion on where to put curly braces, how many blank lines to use (and where), and what a proper comment looks like. Esoteric rationales to inform what (on the surface) seem like so much pedestrian banalia. ("Who cares what I name my local variables?") But by the end, there is a well-reasoned case made for all of the recommendations that will go on to appear in Appendix A.

Where the book becomes more interesting is in Parts II ("Programming Practices") and III ("Automation"). Again: the chapters that comprise Part II are going to seem like review for many seasoned JS devs: keep your JS and your mark-up loosely coupled; avoid global variables; keep configuration data separate from business logic; use feature detection instead of browser detection. As much of these may seem like review (especially if you've been keeping up with Zakas' blog posts), don't get cocky and skim it, either--there are some gems in there. (In particular I'm thinking of the chapter on Event Handling that spawned an interesting post by Ben Nadel.)

The chapters in the Automation section were my favorites. Zakas builds up a solid Ant-based build system over the course of 7 chapters that includes validation and linting, file concatenation and gzipping, minification, documentation, and automated testing. As I've become highly interested in the build process, I was riveted by these chapters. Zakas at least touched on every topic in the automation/build topic that I would have wanted to see. But that being said: I would have loved to see more on this subject. He provides a lot of excellent starter material, and Appendix B is a rich list of other jumping-off points, but it also seemed... shallow? Like he was just scratching the surface? This seemed especially true of the chapters on documentation and testing.

All in all? I would strongly recommend this to folks that are new to JavaScript, but only a mild nudge to seasoned folks.
Was this review helpful to you?
2 of 2 people found the following review helpful
By Manju
Format:Paperback
"Maintainable JavaScript" by Nicholas Zakas (O'Reilly 2012) is a very useful book for programmers who have just started writing javascript code or, for intermediate developers who would like to develop clean and maintainable code. The book is written in a very simple language that is easy to understand and follow.

As the title of the book suggests, the book is aimed at capturing the essential aspects of writing javascript code that is easy to maintain. I liked the flow of the book but I felt that the first few chapters in part 1 could be skipped if the reader is aware of the material.

In part 1 of the book (Style Guidelines), Zakas has given in-depth analysis of styling guidelines to follow that are sometimes skipped when writing large pieces of Javascript code. He touches upon styling guidelines such as: naming conventions, adding comments in the code, understanding the usage of semi-colons etc.,. Some good example use cases and the methodology of using the style guides is presented so that these ideas stick in your mind and become part of the programmers habits.

In part 2 (Programming Practices) - I especially liked the chapter 6 on `avoid global variables' since I have used global variables in my JavaScript but did not think through the caveats of using them. Similar to part 1 of the book, I liked the use cases that the author proposed to describe advantages and disadvantages of several programming aspects that are described in the section. In addition,one of the best described chapters in this section is the material on throwing your own errors (helping you to debug JavaScript code) which I do most of the time using firebug tool on Firefox. Even though this method works I might have to start using some of the techniques described by Zakas in the book, using fascade design pattern on top of objects that are not yours (very interesting outlook) etc.

Part 3 - I like this section a lot especially the material on minification, compression of JavaScript files as the script code adds time delay in loading of the page on the browser. Compression, minification techniques described by the author will definitely help with improving the load performance of the page in the browser.

Some of other things that would have helped me or any other intermediate JavaScript developer is inclusion of example or exercise files for some sections in `part 2'. Examples and exercise files would have helped the understanding of chapters 10, 11 and some sections in part 3 like chapter 17.

It is also interesting to know that author did make an attempt to include Html5 changes for JavaScript in some chapters of part 2 of the book.

I would recommend this book if you are an intermediate developer like me or novice developer for JavaScript code and would like to work towards methods for improving your code and writing a maintainable javascript code as this is book easy to understand and follow.
Comment | 
Was this review helpful to you?
2 of 2 people found the following review helpful
5.0 out of 5 stars Every lead js developer should have this book handy June 18, 2012
By kevinw
Format:Paperback
Some of the book was familiar to me as I feel experienced with JavaScript. The second half of the book is where I really learned some things new. In particular, the build process section was of high interest to me and I really learned a lot from it. I usually keep this book open in .pdf format for quick reference when I need it. If you're serious about your JavaScript, care about your code and having your team stay organized then you should have this book in close reach.
Comment | 
Was this review helpful to you?
Most Recent Customer Reviews
5.0 out of 5 stars Highly Recommended
I don't normally write reviews but felt this book was so good that I felt compelled to spread the word. Read more
Published 2 months ago by JML
5.0 out of 5 stars An excellent guide to practicing better habits.
Few books leave you feeling tangibly better at practicing a computer language. This book is one of them. Read more
Published 3 months ago by James Jeffers
5.0 out of 5 stars Learn about JavaScript and code organization for any language
Very concise and easy to read. Lots of great organization tips to think about when writing in any language plus lots of JavaScript details that I had no idea about having mainly... Read more
Published 3 months ago by Blue Gal
2.0 out of 5 stars I'm dissapointed
When I bought this book actually I was expecting more methodology, with more concepts, classes, oriented objects, templates (more), or similar, but I didn't find anything of this,... Read more
Published 5 months ago by bla
4.0 out of 5 stars A worthy sequel to Douglas Crockford's Javascript: The Good Parts.
TL;DR
It's easy to blaze your own coding trail, perhaps particularly so with Javascript. This book provides a comprehensive glimpse into the workflow and practices of an... Read more
Published 8 months ago by attebury
5.0 out of 5 stars Great book for getting everyone on the same page
I *would* agree with the other reviewers that this book is best for beginner JavaScript programmers, except that I've seen plenty of "3+ years JS experience" developers write... Read more
Published 9 months ago by Brian Nickel
4.0 out of 5 stars A good roadmap for specific audiences
JavaScript has, it seems, finally come into its own, and with its new immense popularity, attracted the attention of opinionated writers of every ilk. Read more
Published 10 months ago by Nicholas Cloud
4.0 out of 5 stars Maintainable JavaScript
This is another JavaScript best practices book from O'Reilly, following JavaScript: The Good Parts and JavaScript Patterns. Read more
Published 11 months ago by Eric Jain
5.0 out of 5 stars Essential Reading for Anyone Doing JS on a Team.
I'm a UI product architect for a company called oDesk. I manage a team of 5-7 engineers who build re-usable UI pieces in HTML, CSS and JavaScript. Read more
Published 11 months ago by Jamund Ferguson
Search Customer Reviews
Only search this product's reviews

What Other Items Do Customers Buy After Viewing This Item?


Forums

There are no discussions about this product yet.
Be the first to discuss this product with the community.
Start a new discussion
Topic:
First post:
Prompts for sign-in
 



So You'd Like to...


Create a guide


Look for Similar Items by Category