<?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://unfoldingneurons.com/"
		>
<channel>
	<title>Comments on: Peer Review: Improving The Business Logic</title>
	<atom:link href="http://www.brandonsavage.net/peer-review-improving-the-business-logic/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brandonsavage.net/peer-review-improving-the-business-logic/</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>Thu, 29 Jul 2010 11:09:38 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Albert Lombarte</title>
		<link>http://www.brandonsavage.net/peer-review-improving-the-business-logic/#comment-1411</link>
		<dc:creator>Albert Lombarte</dc:creator>
		<pubDate>Wed, 30 Sep 2009 07:48:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=596#comment-1411</guid>
		<description>Hello Brandon,

I don&#039;t know how I arrived here, nor I am using any of this techniques (I use multicurl for massive querying), but just a little bit of advise regarding the json_encode.

There is a bug with large integers and the PHP json_encode/decode functions in 32-bit machines (mere mortals usually use that). If you do not have a 64-bit machine the integers decoded will be corrupted, and you will have wrong twitter IDs.

You should either use a 64-bit machine or surround the numerical values with &quot;&quot; before decoding the response (treat them as strings).

My 5 cents</description>
		<content:encoded><![CDATA[<p>Hello Brandon,</p>
<p>I don&#8217;t know how I arrived here, nor I am using any of this techniques (I use multicurl for massive querying), but just a little bit of advise regarding the json_encode.</p>
<p>There is a bug with large integers and the PHP json_encode/decode functions in 32-bit machines (mere mortals usually use that). If you do not have a 64-bit machine the integers decoded will be corrupted, and you will have wrong twitter IDs.</p>
<p>You should either use a 64-bit machine or surround the numerical values with &#8220;&#8221; before decoding the response (treat them as strings).</p>
<p>My 5 cents</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brandon Savage</title>
		<link>http://www.brandonsavage.net/peer-review-improving-the-business-logic/#comment-1160</link>
		<dc:creator>Brandon Savage</dc:creator>
		<pubDate>Tue, 15 Sep 2009 12:21:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=596#comment-1160</guid>
		<description>Good point. And you&#039;re 100% right. :-)</description>
		<content:encoded><![CDATA[<p>Good point. And you&#8217;re 100% right. :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wil Moore III</title>
		<link>http://www.brandonsavage.net/peer-review-improving-the-business-logic/#comment-1157</link>
		<dc:creator>Wil Moore III</dc:creator>
		<pubDate>Tue, 15 Sep 2009 05:30:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=596#comment-1157</guid>
		<description>Brandon,

Nice article. BTW, instead of this:

if(isset($array[&#039;id&#039;]) AND $array[&#039;id&#039;] &gt; 0)

the following is more concise:

if (! empty($array[&#039;id&#039;]))

!empty works just like isset in that it will check that the variable/array index is set but also has the added value of ensuring that the value is not an &quot;empty&quot; value like false, 0, or NULL.

One precaution though...if you are accepting 0 as a valid value, you don&#039;t want to use empty because a value of 0 will cause empty to return false.

BTW, given the fact that you have set &quot;error_reporting(E_ALL)&quot; you most certainly will be getting a NOTICE if you omit the empty or isset call. If you didn&#039;t see the notice, it could be that you have display_errors = false.


-Wil Moore III</description>
		<content:encoded><![CDATA[<p>Brandon,</p>
<p>Nice article. BTW, instead of this:</p>
<p>if(isset($array['id']) AND $array['id'] &gt; 0)</p>
<p>the following is more concise:</p>
<p>if (! empty($array['id']))</p>
<p>!empty works just like isset in that it will check that the variable/array index is set but also has the added value of ensuring that the value is not an &#8220;empty&#8221; value like false, 0, or NULL.</p>
<p>One precaution though&#8230;if you are accepting 0 as a valid value, you don&#8217;t want to use empty because a value of 0 will cause empty to return false.</p>
<p>BTW, given the fact that you have set &#8220;error_reporting(E_ALL)&#8221; you most certainly will be getting a NOTICE if you omit the empty or isset call. If you didn&#8217;t see the notice, it could be that you have display_errors = false.</p>
<p>-Wil Moore III</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brandon Savage</title>
		<link>http://www.brandonsavage.net/peer-review-improving-the-business-logic/#comment-1108</link>
		<dc:creator>Brandon Savage</dc:creator>
		<pubDate>Wed, 09 Sep 2009 11:22:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=596#comment-1108</guid>
		<description>I agree. We&#039;ll be removing that next, when we write some unit tests.</description>
		<content:encoded><![CDATA[<p>I agree. We&#8217;ll be removing that next, when we write some unit tests.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Giorgio Sironi</title>
		<link>http://www.brandonsavage.net/peer-review-improving-the-business-logic/#comment-1107</link>
		<dc:creator>Giorgio Sironi</dc:creator>
		<pubDate>Wed, 09 Sep 2009 10:36:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=596#comment-1107</guid>
		<description>I agree on the isset, everyone should develop in E_ALL &#124; E_STRICT mode. What worries me is the $this-&gt;test variable where a mock object could be used.</description>
		<content:encoded><![CDATA[<p>I agree on the isset, everyone should develop in E_ALL | E_STRICT mode. What worries me is the $this-&gt;test variable where a mock object could be used.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brandon Savage</title>
		<link>http://www.brandonsavage.net/peer-review-improving-the-business-logic/#comment-1104</link>
		<dc:creator>Brandon Savage</dc:creator>
		<pubDate>Tue, 08 Sep 2009 21:16:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=596#comment-1104</guid>
		<description>You&#039;re right, and you jumped a bit ahead on me. That fact is discussed in the architectural entry, which is next Monday.</description>
		<content:encoded><![CDATA[<p>You&#8217;re right, and you jumped a bit ahead on me. That fact is discussed in the architectural entry, which is next Monday.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruce Weirdan</title>
		<link>http://www.brandonsavage.net/peer-review-improving-the-business-logic/#comment-1103</link>
		<dc:creator>Bruce Weirdan</dc:creator>
		<pubDate>Tue, 08 Sep 2009 20:55:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=596#comment-1103</guid>
		<description>&gt;This is a bad practice for one reason: it makes the object unusable a second time!

Your object is unusable a second time anyway, since you&#039;re not resetting $this-&gt;done.</description>
		<content:encoded><![CDATA[<p>&gt;This is a bad practice for one reason: it makes the object unusable a second time!</p>
<p>Your object is unusable a second time anyway, since you&#8217;re not resetting $this-&gt;done.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jake Smith</title>
		<link>http://www.brandonsavage.net/peer-review-improving-the-business-logic/#comment-1102</link>
		<dc:creator>Jake Smith</dc:creator>
		<pubDate>Tue, 08 Sep 2009 12:34:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=596#comment-1102</guid>
		<description>Brandon, that is what I thought, but I wanted to make sure I wasn&#039;t missing something.  You&#039;re completely right that it is good practice and should be implemented.

Once again, great series.</description>
		<content:encoded><![CDATA[<p>Brandon, that is what I thought, but I wanted to make sure I wasn&#8217;t missing something.  You&#8217;re completely right that it is good practice and should be implemented.</p>
<p>Once again, great series.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brandon Savage</title>
		<link>http://www.brandonsavage.net/peer-review-improving-the-business-logic/#comment-1101</link>
		<dc:creator>Brandon Savage</dc:creator>
		<pubDate>Tue, 08 Sep 2009 11:54:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=596#comment-1101</guid>
		<description>Jake, my understanding was that attempting to use a key that was undefined would emit a notice. However, testing on that seems to indicate that I am mistaken.

The isset() appears to be unnecessary. However, I might still keep it for two reasons: first, it explicitly checks to make sure that the ID value is set, and even though that condition would be satisfied by the second check, it&#039;s obvious as soon as you look at it. Second, because undefined variables will emit errors (for example, if you test for the presence of $value but don&#039;t define $value you get a notice), it&#039;s a good practice to use isset() to test for value initialization before testing for the actual value.</description>
		<content:encoded><![CDATA[<p>Jake, my understanding was that attempting to use a key that was undefined would emit a notice. However, testing on that seems to indicate that I am mistaken.</p>
<p>The isset() appears to be unnecessary. However, I might still keep it for two reasons: first, it explicitly checks to make sure that the ID value is set, and even though that condition would be satisfied by the second check, it&#8217;s obvious as soon as you look at it. Second, because undefined variables will emit errors (for example, if you test for the presence of $value but don&#8217;t define $value you get a notice), it&#8217;s a good practice to use isset() to test for value initialization before testing for the actual value.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jake Smith</title>
		<link>http://www.brandonsavage.net/peer-review-improving-the-business-logic/#comment-1100</link>
		<dc:creator>Jake Smith</dc:creator>
		<pubDate>Tue, 08 Sep 2009 11:46:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=596#comment-1100</guid>
		<description>Another great article Brandon.  Quick question.

Is there any reason why you chose to do an isset along with checking if the id was greater than 0? (line 173)</description>
		<content:encoded><![CDATA[<p>Another great article Brandon.  Quick question.</p>
<p>Is there any reason why you chose to do an isset along with checking if the id was greater than 0? (line 173)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk (feed is rejected)
Page Caching using apc (user agent is rejected)
Database Caching 44/51 queries in 0.020 seconds using disk
Content Delivery Network via Amazon Web Services: S3: files.brandonsavage.net.s3.amazonaws.com

Served from: www.brandonsavage.net @ 2010-07-31 11:01:30 -->