Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I've worked in places with barely-followed coding practices, and others where they're close to being enforced - or at least easily checked.</p> <p>A few suggestions:</p> <ul> <li>The most important thing is to get buy-in to the idea that consistency trumps your personal preferred style. There should be discussion of the coding standard both before and after it's instituted, but no-one should be allowed to just opt out of it.</li> <li>Code reviews should be mandatory, with the checkin comment including the username of the reviewer. If you're using a suitably powerful SCM, consider not allowing checkins which don't have a valid reviewer name.</li> <li>There should be a document which <em>everyone</em> knows about laying out the coding standards. With enough detail, you shouldn't get too much in the way of arguments.</li> <li>Where possible, automate checking of the conventions (via Lint, CheckStyle, FXCop etc) so it's easy for both the committer and the reviewer to get a quick check of things like ordering import/using directives, whitespace etc.</li> </ul> <p>The benefits are:</p> <ul> <li>Primarily consistency - if you make it so that anyone can feel "at home" in any part of the codebase at any time, it gives you more flexibility.</li> <li>Spreading best practice - if you ban public fields, mutable structs etc then no-one can accidentally plant a time bomb in your code. (At least, not a time bomb that's covered by the standard. There's no coding standard for perfect code, of course :)</li> </ul> <p>EDIT: I should point out that coding standards are probably <em>most</em> important when working in large companies. I believe they help even in small companies, but there's probably less need of process around the standard at that point. It helps when all the developers know each other personally and are all co-located.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload