Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Count me in among those who evangelise CodeSniffer. After being highly sceptical for years, I now use it on every project I'm working on. Why?</p> <p>As Grace Hopper and/or Andrew Tanenbaum famously said,</p> <blockquote> <p>The wonderful thing about standards is that you have so many to choose from.</p> </blockquote> <p>Likewise, it's almost always a Bad Idea&trade; to create your own coding standard; creating one comprehensive enough to cover all your code is <em>hard</em>, and, much more importantly, it will not be to the liking of the next person to maintain your code, who will try to "improve" your standard so that it suits his long-held coding style. Adopting an <em>appropriate</em> outside standard, whether it's Zend or PEAR or Kohana or JoeBobBriggsAndHisFifthCousin, allows you to concentrate on the <em>content</em> rather than the <em>formatting</em>. Better still, tools like PHP CodeSniffer either support the standard "fresh out of the tin" or those who have gone before have almost certainly implemented support as an add-on.</p> <p>Mixing coding standards with existing code not written to that standard will give you fits, unless you adopt two simple, complementary rules.</p> <blockquote> <p>Exclude files which predate your adoption of the coding standard from being checked, through the <code>--ignore</code> command-line option or equivalent configuration-file settings. But, when you do modify <em>any part</em> of a source file, update the entire file to comply with your chosen standard.</p> </blockquote> <p>I just <a href="http://archlever.blogspot.com/2010/07/automating-so-you-dont-forget.html" rel="noreferrer">wrote a new blog post</a> about this sort of thing.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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