<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:series="http://organizeseries.com/"
		>
<channel>
	<title>Comments on: Peer Review: Managing Coding Standards</title>
	<atom:link href="http://www.brandonsavage.net/peer-review-managing-coding-standards/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brandonsavage.net/peer-review-managing-coding-standards/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=peer-review-managing-coding-standards</link>
	<description>The personal blog of Brandon Savage. Contains entries of a personal and professional nature focusing on PHP, Apple, LAMP, MySQL and Washington, DC.</description>
	<lastBuildDate>Wed, 15 May 2013 14:54:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.2-alpha</generator>
	<item>
		<title>By: Brandon Savage</title>
		<link>http://www.brandonsavage.net/peer-review-managing-coding-standards/#comment-960</link>
		<dc:creator>Brandon Savage</dc:creator>
		<pubDate>Tue, 18 Aug 2009 11:55:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=558#comment-960</guid>
		<description><![CDATA[I&#039;ve seen the pre-commit hook standards check, and while I think it&#039;s not a bad idea I don&#039;t use it. Here&#039;s why:

* If you have lots of code to commit you can potentially cause the SVN commit process to &quot;hang.&quot;
* You can use CI (continuous integration) to instead check the standards and email out notices to the staff if someone checks in a bad copy of the code.

I do recommend a pre-commit hook that checks to make sure code lints (that is, it compiles) but beyond that, I think the work should be done post-commit. See http://blueparabola.com/blog/subversion-commit-hooks-php for more.]]></description>
		<content:encoded><![CDATA[<p>I&#8217;ve seen the pre-commit hook standards check, and while I think it&#8217;s not a bad idea I don&#8217;t use it. Here&#8217;s why:</p>
<p>* If you have lots of code to commit you can potentially cause the SVN commit process to &#8220;hang.&#8221;<br />
* You can use CI (continuous integration) to instead check the standards and email out notices to the staff if someone checks in a bad copy of the code.</p>
<p>I do recommend a pre-commit hook that checks to make sure code lints (that is, it compiles) but beyond that, I think the work should be done post-commit. See <a href="http://blueparabola.com/blog/subversion-commit-hooks-php" rel="nofollow">http://blueparabola.com/blog/subversion-commit-hooks-php</a> for more.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tarique Sani</title>
		<link>http://www.brandonsavage.net/peer-review-managing-coding-standards/#comment-959</link>
		<dc:creator>Tarique Sani</dc:creator>
		<pubDate>Tue, 18 Aug 2009 06:00:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=558#comment-959</guid>
		<description><![CDATA[One tool that I have found really helpful in ensuring coding standards is PHP_CodeSniffer in the SVN/GIT pre-commit hook. You can&#039;t commit if you don&#039;t comply :D]]></description>
		<content:encoded><![CDATA[<p>One tool that I have found really helpful in ensuring coding standards is PHP_CodeSniffer in the SVN/GIT pre-commit hook. You can&#8217;t commit if you don&#8217;t comply :D</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brandon Savage</title>
		<link>http://www.brandonsavage.net/peer-review-managing-coding-standards/#comment-958</link>
		<dc:creator>Brandon Savage</dc:creator>
		<pubDate>Tue, 18 Aug 2009 01:25:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=558#comment-958</guid>
		<description><![CDATA[Noel, the DocBlocks aren&#039;t for when you&#039;re reading the code. It&#039;s for when you&#039;re generating documentation. For example, I work with a large body of documentation, all of which is docblocked. I can instantly generate documentation that shows me the entire public API.

DocBlocks are not, in my opinion, for the person reviewing the code (beyond some basics). They&#039;re for someone looking at the API.

And good point about the public properties versus accessors. That&#039;s my take, too.]]></description>
		<content:encoded><![CDATA[<p>Noel, the DocBlocks aren&#8217;t for when you&#8217;re reading the code. It&#8217;s for when you&#8217;re generating documentation. For example, I work with a large body of documentation, all of which is docblocked. I can instantly generate documentation that shows me the entire public API.</p>
<p>DocBlocks are not, in my opinion, for the person reviewing the code (beyond some basics). They&#8217;re for someone looking at the API.</p>
<p>And good point about the public properties versus accessors. That&#8217;s my take, too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: noel darlow</title>
		<link>http://www.brandonsavage.net/peer-review-managing-coding-standards/#comment-957</link>
		<dc:creator>noel darlow</dc:creator>
		<pubDate>Tue, 18 Aug 2009 01:20:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=558#comment-957</guid>
		<description><![CDATA[Personally I hate doc blocks. They don&#039;t tell me anything useful. Take this for example:

    /**
     * Constructor.
     * @param string $username The username of the Twitter user
     * @param string $password The password of the Twitter user
     * @param string $email Optional email address for testing
     * @return void
     */
    public function __construct($username, $password, $email = null)
    {

I can see it&#039;s a constructor. I can guess what &quot;$username&quot; is because it&#039;s well-named, and I can guess that it&#039;s a string. Ditto all the other args. You could delete the lot without losing any useful information. I think *the* key programming skill is learning to express ideas clearly, simply, and concisely. That means constantly cutting and hacking away at cruft.

Short methods which do just one thing help. If this waas split into a _hasBeenPosted($tweet) and _saveTweet($tweet) (roost?) a comment isn&#039;t needed.

/**
     * Check to see if this tweet has already been posted and add it to the DB
     * if it has.
     * @param string $message The tweet
     * @return bool
     */
    private function already_tweeted($message) {

Good naming virtually removes the need for comments - also testing. Code is best explained in well-factored unit tests which tell little stories about how classes are used and how they will behave. I think this is where the focus should be when you want to learn (or show) how code works. Comments may get out of step with the code but tests never lie.

Definitely agree that private is evil (open-closed principle). 

And always use accessors. I&#039;m a Scot and as we know Scotsmen all wear kilts hoots mon och aye the noo etc etc. For better or worse, it seems there is unending interest in what we wear underneath. Now, if you met me, I&#039;m sure you&#039;d ask politely using my public ear interface. You wouldn&#039;t just hoik up my kilt and have a good old rummage around, leaving me exposed to the inclement Scottish summer.

I sort of feel the same way about direct property access.]]></description>
		<content:encoded><![CDATA[<p>Personally I hate doc blocks. They don&#8217;t tell me anything useful. Take this for example:</p>
<p>    /**<br />
     * Constructor.<br />
     * @param string $username The username of the Twitter user<br />
     * @param string $password The password of the Twitter user<br />
     * @param string $email Optional email address for testing<br />
     * @return void<br />
     */<br />
    public function __construct($username, $password, $email = null)<br />
    {</p>
<p>I can see it&#8217;s a constructor. I can guess what &#8220;$username&#8221; is because it&#8217;s well-named, and I can guess that it&#8217;s a string. Ditto all the other args. You could delete the lot without losing any useful information. I think *the* key programming skill is learning to express ideas clearly, simply, and concisely. That means constantly cutting and hacking away at cruft.</p>
<p>Short methods which do just one thing help. If this waas split into a _hasBeenPosted($tweet) and _saveTweet($tweet) (roost?) a comment isn&#8217;t needed.</p>
<p>/**<br />
     * Check to see if this tweet has already been posted and add it to the DB<br />
     * if it has.<br />
     * @param string $message The tweet<br />
     * @return bool<br />
     */<br />
    private function already_tweeted($message) {</p>
<p>Good naming virtually removes the need for comments &#8211; also testing. Code is best explained in well-factored unit tests which tell little stories about how classes are used and how they will behave. I think this is where the focus should be when you want to learn (or show) how code works. Comments may get out of step with the code but tests never lie.</p>
<p>Definitely agree that private is evil (open-closed principle). </p>
<p>And always use accessors. I&#8217;m a Scot and as we know Scotsmen all wear kilts hoots mon och aye the noo etc etc. For better or worse, it seems there is unending interest in what we wear underneath. Now, if you met me, I&#8217;m sure you&#8217;d ask politely using my public ear interface. You wouldn&#8217;t just hoik up my kilt and have a good old rummage around, leaving me exposed to the inclement Scottish summer.</p>
<p>I sort of feel the same way about direct property access.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: evll</title>
		<link>http://www.brandonsavage.net/peer-review-managing-coding-standards/#comment-955</link>
		<dc:creator>evll</dc:creator>
		<pubDate>Mon, 17 Aug 2009 17:55:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=558#comment-955</guid>
		<description><![CDATA[&quot;But there’s something else about the properties that we need to examine. Because the properties are private, this class cannot be extended. This might be an intentional architectural choice; however, it is more likely that the author just didn’t consider the possibility of extension.&quot;

Soooo wrong. protected is no more encapsulated than public. Suppose we have a public data member, and we eliminate it. How much code might be broken? All the client code that uses it, which is generally an unknowably large amount. Public data members are thus completely unencapsulated. But suppose we have a protected data member, and we eliminate it. How much code might be broken now? All the derived classes that use it, which is, again, typically an unknowably large amount of code. Once you&#039;ve declared a data member public or protected and clients have started using it, it&#039;s very hard to change anything about that data member.]]></description>
		<content:encoded><![CDATA[<p>&#8220;But there’s something else about the properties that we need to examine. Because the properties are private, this class cannot be extended. This might be an intentional architectural choice; however, it is more likely that the author just didn’t consider the possibility of extension.&#8221;</p>
<p>Soooo wrong. protected is no more encapsulated than public. Suppose we have a public data member, and we eliminate it. How much code might be broken? All the client code that uses it, which is generally an unknowably large amount. Public data members are thus completely unencapsulated. But suppose we have a protected data member, and we eliminate it. How much code might be broken now? All the derived classes that use it, which is, again, typically an unknowably large amount of code. Once you&#8217;ve declared a data member public or protected and clients have started using it, it&#8217;s very hard to change anything about that data member.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brandon Savage</title>
		<link>http://www.brandonsavage.net/peer-review-managing-coding-standards/#comment-953</link>
		<dc:creator>Brandon Savage</dc:creator>
		<pubDate>Mon, 17 Aug 2009 16:30:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=558#comment-953</guid>
		<description><![CDATA[I also tend to use the camel casing, and that&#039;s a good point that I missed. To me, that&#039;s less important than items that can cause big problems later on, but you are 100% right.

I also didn&#039;t address making the variables easier to read and understand by just looking at them. I didn&#039;t want to open that can of worms.

Thanks for the suggestion!]]></description>
		<content:encoded><![CDATA[<p>I also tend to use the camel casing, and that&#8217;s a good point that I missed. To me, that&#8217;s less important than items that can cause big problems later on, but you are 100% right.</p>
<p>I also didn&#8217;t address making the variables easier to read and understand by just looking at them. I didn&#8217;t want to open that can of worms.</p>
<p>Thanks for the suggestion!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ralph Schindler</title>
		<link>http://www.brandonsavage.net/peer-review-managing-coding-standards/#comment-952</link>
		<dc:creator>Ralph Schindler</dc:creator>
		<pubDate>Mon, 17 Aug 2009 16:15:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=558#comment-952</guid>
		<description><![CDATA[One note, perhaps its just a small note:

Generally, when creating classes in PHP, and using PHP&#039;s OO-goodness, I like (as to PEAR and ZF standards) to name members such as methods and properties with camelCasing.  Thus &quot;already_tweeted&quot; would be &quot;alreadyTweeted&quot;.  

On the other hand, I like to use under_scored naming for procedural paradigm members: functions and variables, when they are used in a predominantly functional/procedural/imperative environment.]]></description>
		<content:encoded><![CDATA[<p>One note, perhaps its just a small note:</p>
<p>Generally, when creating classes in PHP, and using PHP&#8217;s OO-goodness, I like (as to PEAR and ZF standards) to name members such as methods and properties with camelCasing.  Thus &#8220;already_tweeted&#8221; would be &#8220;alreadyTweeted&#8221;.  </p>
<p>On the other hand, I like to use under_scored naming for procedural paradigm members: functions and variables, when they are used in a predominantly functional/procedural/imperative environment.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sudheer</title>
		<link>http://www.brandonsavage.net/peer-review-managing-coding-standards/#comment-948</link>
		<dc:creator>Sudheer</dc:creator>
		<pubDate>Mon, 17 Aug 2009 05:28:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=558#comment-948</guid>
		<description><![CDATA[Nice article. The world will be so different if every PHP beginner takes coding standards serious.]]></description>
		<content:encoded><![CDATA[<p>Nice article. The world will be so different if every PHP beginner takes coding standards serious.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (Feed is rejected)
Page Caching using disk: enhanced (User agent is rejected)
Object Caching 559/573 objects using apc
Content Delivery Network via Amazon Web Services: S3: brandonsavage-net-files.s3.amazonaws.com

 Served from: www.brandonsavage.net @ 2013-05-23 15:27:26 by W3 Total Cache -->