Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Js coding standards

1,400 views

Published on

why JavaScript coding standards are important to us.

Published in: Technology
  • Login to see the comments

  • Be the first to like this

Js coding standards

  1. 1. 1 © 2005 Nokia V1-Filename.ppt / yyyy-mm-dd / Initials<br /> Why do we need coding standards?<br />
  2. 2. 2 © 2005 Nokia V1-Filename.ppt / yyyy-mm-dd / Initials<br /> Broken windows theory.<br />“One broken window, left unrepaired for any substantial length of time, instills in the inhabitants of the building a sense of abandonment—a sense that the powers that be don’t care about the building. So another window gets broken. People start littering. Graffiti appears. Serious structural damage begins. In a relatively short space of time, the building becomes damaged beyond the owner’s desire to fix it, and the sense of abandonment becomes reality.”<br />
  3. 3. 3 © 2005 Nokia V1-Filename.ppt / yyyy-mm-dd / Initials<br /> Examples of broken windows in javascript :<br />Missing semi-colons.<br />Missing commas.<br />Undefined variables<br />Console & alert debug statements<br />Explicit equality checks<br />As a matter of priority we need to make sure these basic errors are not checked in to the codebase.<br />
  4. 4. 4 © 2005 Nokia V1-Filename.ppt / yyyy-mm-dd / Initials<br /> How to test before you check-in?<br />Run “mvn validate” at the command line<br /> Play with the JSLintconfig.<br /><ul><li>/static-resources/jslint.xml</li></ul>Let’s clean house and then organically adjust our coding standards as needed.<br />

×