Maintainable JavaScript
Writing Readable Code
Publisher: O'Reilly Media
Released: May 2012
Pages: 242
Watch Online for Free >

Enjoy this Best of Fluent preview, brought to you by the O'Reilly Fluent Conference

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
Table of Contents
Product Details
About the Author
Colophon
Recommended for You
Customer Reviews

REVIEW SNAPSHOT®

by PowerReviews
oreillyMaintainable JavaScript
 
4.6

(based on 5 reviews)

Ratings Distribution

  • 5 Stars

     

    (3)

  • 4 Stars

     

    (2)

  • 3 Stars

     

    (0)

  • 2 Stars

     

    (0)

  • 1 Stars

     

    (0)

100%

of respondents would recommend this to a friend.

Pros

  • Easy to understand (3)
  • Helpful examples (3)
  • Well-written (3)

Cons

    Best Uses

    • Intermediate (3)
      • Reviewer Profile:
      • Developer (3)

    Reviewed by 5 customers

    Sort by

    Displaying reviews 1-5

    Back to top

     
    4.0

    Great Resource -- And Not Just For Teams

    By Steve

    from Boulder, CO

    About Me Developer

    Verified Reviewer

    Pros

    • Easy to understand
    • Helpful examples
    • Well-written

    Cons

      Best Uses

      • Intermediate
      • Novice
      • Student

      Comments about oreilly Maintainable JavaScript:

      Similar to the story Mr. Zakas tells, I began using JavaScript in the '90s as a minor component of web development, accreting knowledge as necessary without much systematic effort. In the last few years, that once minor component has become major, often THE major component of a web project, and my helter-skelter approach (I call it BF&I — "Brute Force & Ignorance") to writing JavaScript has started to reveal its deficiencies — and now this book has found its way into my hands at just the right time.

      There are three main sections here: "Style Guidelines" (e.g. spaces or tabs, naming conventions), "Programming Practices" (keep JavaScript out of CSS, keep CSS out of JavaScript, etc.), and "Automation" (he's in favor of it). In each section, Zakas recommends best practices, always providing thoughtful arguments for and against his recommendations and good alternatives to them.

      With his advice, judiciously employed, I've begun to square myself away, and although this hasn't made me a rock-star, it has increased my productivity and decreased my stress-level, and with a good set of standard practices building up I can spend more energy improving my programming skills rather than struggling with my work flow.

      Mr. Zakas writes "[T]hese techniques are really aimed at a multideveloper environment in which there are many engineers all working on the same code", and probably that is the best use, but even a solo freelancer, like myself, can find a lot of good counsel here — we're always, after all, collaborating at least with our future selves.

      The only criticism I have of the book is the singular use of Ant to describe automating build tools, a choice that makes the "Automation" section of the book less widely applicable, and mostly uninteresting to me, at least for the time being.

      Mr. Zakas has an engaging style, devoid of the forced goofiness that often plagues tech-writers. Confidant in his own abilities and respectful of the reader, he consistently provides valuable and enjoyable reading. I'll be reading this again, soon.

      (0 of 1 customers found this review helpful)

       
      5.0

      Ever JS developer should read this book

      By milkman

      from new york

      Verified Reviewer

      Comments about oreilly Maintainable JavaScript:

      I learned a ton from this book, it made me a much better developer and made my code last much longer out in the wild.

      (0 of 1 customers found this review helpful)

       
      5.0

      Great book

      By Rogelio Morrell

      from Panama

      Verified Reviewer

      Comments about oreilly Maintainable JavaScript:

      Should be standard for any entry level developer

      (1 of 1 customers found this review helpful)

       
      5.0

      Think you don't need it? You're wrong.

      By Annabel

      from Austin, TX

      About Me Designer, Developer

      Verified Reviewer

      Pros

      • Easy to understand
      • Helpful examples
      • Well-written

      Cons

        Best Uses

        • Intermediate
        • Novice
        • Student

        Comments about oreilly Maintainable JavaScript:

        Nearly ten years ago, 37signals published a book called "Defensive Web Design." And I remember reading a bazillion reviews of it that said, basically, "This stuff is OBVIOUS."

        Oh yeah? Of course it's obvious, except you're not doing it! Nowhere is the Curse of Knowledge more obvious than in website UX design, where we just assume that of course people know how to [enter a phone number/make a purchase/search your site]. In truth, the people who dismissed the book out of hand are probably the ones who needed it most.

        "Maintainable Javascript" reminds me a lot of that. It starts as basic as it gets, with code formatting--indentation, brace positioning, spaces around operators, stuff like that. It continues to principles like DRY, separation of concerns, and so forth. It's stuff we all know. And yet, it's so easy to find code being written right now that violates all of these principles... usually under the claim of "I'll go back and clean it up later" or "formatting doesn't matter" or "I gotta get this feature done by EOB today" or some other excuse. Everybody knows better, but sometimes, when you're just knocking stuff out in a hurry...

        Reading this book is rather like reading a book about the damage that unhealthy eating can do, after you've been on a diet for several months and have felt the benefits but started to backslide. For anyone but a rank beginner, it's a refresher, not new information. But we need that reminder of how important it is to maintain those good habits, or maybe to add a few to our toolbox.

        Two thumbs up for clear writing, good examples, and general usefulness.

        (1 of 1 customers found this review helpful)

         
        4.0

        Great for Front End Developers

        By Atom Bomb Speedster

        from London

        About Me Designer, Developer

        Verified Reviewer

        Pros

        • Concise
        • Easy to understand
        • Helpful examples
        • Well-written

        Cons

          Best Uses

          • Expert
          • Intermediate

          Comments about oreilly Maintainable JavaScript:

          The use of JavaScript has radically changed over the last decade or so, transforming from being used for simple form validation and eye-candy into an entire webapp development system within its own right.

          This book is ideal for people who know the language, but wish to apply it more professionally within commercial projects that are heavily dependent on good JavaScript. It is also ideal for contractors who need to know the most common practices for deployment and testing in a nutshell.

          Displaying reviews 1-5

          Back to top

           
          Buy 2 Get 1 Free Free Shipping Guarantee
          Buying Options
          Immediate Access - Go Digital what's this?
          Ebook: $27.99
          Formats:  DAISY, ePub, Mobi, PDF
          Print & Ebook: $38.49
          Print: $34.99