<?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: Be Wary of User Contributed Notes</title>
	<atom:link href="http://www.brandonsavage.net/be-wary-of-user-contributed-notes/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brandonsavage.net/be-wary-of-user-contributed-notes/</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>Fri, 03 Feb 2012 19:36:33 -0500</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: fqqdk</title>
		<link>http://www.brandonsavage.net/be-wary-of-user-contributed-notes/#comment-2650</link>
		<dc:creator>fqqdk</dc:creator>
		<pubDate>Thu, 10 Dec 2009 23:54:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=1045#comment-2650</guid>
		<description>I like user contributed snippets, especially those of the &quot;array_*_recursive&quot; kind; almost every single array_* function which doesn&#039;t have a native &quot;recursive&quot; version will have a user-contributed implementation. It just never gets boring.
BTW, can you provide a formatting option to this comment-box so that we can use http://www.glennmcanally.com/sarcastic/ ? :)</description>
		<content:encoded><![CDATA[<p>I like user contributed snippets, especially those of the &#8220;array_*_recursive&#8221; kind; almost every single array_* function which doesn&#8217;t have a native &#8220;recursive&#8221; version will have a user-contributed implementation. It just never gets boring.<br />
BTW, can you provide a formatting option to this comment-box so that we can use <a href="http://www.glennmcanally.com/sarcastic/" rel="nofollow">http://www.glennmcanally.com/sarcastic/</a> ? :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marat Denenberg</title>
		<link>http://www.brandonsavage.net/be-wary-of-user-contributed-notes/#comment-2258</link>
		<dc:creator>Marat Denenberg</dc:creator>
		<pubDate>Mon, 23 Nov 2009 19:14:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=1045#comment-2258</guid>
		<description>A more robust comment system will resolve issues like this. As someone mentioned, voting comments up/down, replies to comments, etc. Then again, I&#039;m grateful that you CAN leave comments. Being able to comment on a manual is still pretty damn great and beats a wiki. Sometimes things are useful, but don&#039;t belong in a manual.</description>
		<content:encoded><![CDATA[<p>A more robust comment system will resolve issues like this. As someone mentioned, voting comments up/down, replies to comments, etc. Then again, I&#8217;m grateful that you CAN leave comments. Being able to comment on a manual is still pretty damn great and beats a wiki. Sometimes things are useful, but don&#8217;t belong in a manual.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tommy Smith</title>
		<link>http://www.brandonsavage.net/be-wary-of-user-contributed-notes/#comment-2253</link>
		<dc:creator>Tommy Smith</dc:creator>
		<pubDate>Mon, 23 Nov 2009 16:49:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=1045#comment-2253</guid>
		<description>Nice article Brandon. I agree that developers need to be reminded now and then that user contributed code is very much &quot;use at your own risk&quot;. I have seen a ton of code on php.net that is NOT optimal - but poorly written code does a lot to train php newbies and keep non-newbies thinking. When I see verbose code, it serves two purposes. It helps me to remember how a new programmer thinks. And, it takes my mind outside the box. My first thought was the same as yours, just use &#039;w&#039; to get day of week. Then, as I realized the developer was trying to do more - my thoughts expanded into better ways to do write the same code. For those of us that are senior developers - code like this fine tunes our ability to evaluate and criticize code. I say - let the newbees add stuff like this - then, if a senior programmer thinks of a better way - let him/her contribute it too :-)</description>
		<content:encoded><![CDATA[<p>Nice article Brandon. I agree that developers need to be reminded now and then that user contributed code is very much &#8220;use at your own risk&#8221;. I have seen a ton of code on php.net that is NOT optimal &#8211; but poorly written code does a lot to train php newbies and keep non-newbies thinking. When I see verbose code, it serves two purposes. It helps me to remember how a new programmer thinks. And, it takes my mind outside the box. My first thought was the same as yours, just use &#8216;w&#8217; to get day of week. Then, as I realized the developer was trying to do more &#8211; my thoughts expanded into better ways to do write the same code. For those of us that are senior developers &#8211; code like this fine tunes our ability to evaluate and criticize code. I say &#8211; let the newbees add stuff like this &#8211; then, if a senior programmer thinks of a better way &#8211; let him/her contribute it too :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brandon Savage</title>
		<link>http://www.brandonsavage.net/be-wary-of-user-contributed-notes/#comment-2252</link>
		<dc:creator>Brandon Savage</dc:creator>
		<pubDate>Mon, 23 Nov 2009 16:42:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=1045#comment-2252</guid>
		<description>Peter, the note didn&#039;t explain. Here is the full text of the note:

&quot;Function which simply returns numeric specification what day of week was(or will be) at given date (same schema as date(&quot;w&quot;)). Works both for future and past dates. Counting starts from 0 for Sunday and ends at 7 for Saturday. Hope it will help anybody. ;)
Here&#039;s the function: &quot;

I removed the function as it&#039;s in the post above.</description>
		<content:encoded><![CDATA[<p>Peter, the note didn&#8217;t explain. Here is the full text of the note:</p>
<p>&#8220;Function which simply returns numeric specification what day of week was(or will be) at given date (same schema as date(&#8220;w&#8221;)). Works both for future and past dates. Counting starts from 0 for Sunday and ends at 7 for Saturday. Hope it will help anybody. ;)<br />
Here&#8217;s the function: &#8221;</p>
<p>I removed the function as it&#8217;s in the post above.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon</title>
		<link>http://www.brandonsavage.net/be-wary-of-user-contributed-notes/#comment-2247</link>
		<dc:creator>Jon</dc:creator>
		<pubDate>Mon, 23 Nov 2009 14:06:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=1045#comment-2247</guid>
		<description>To say that user contributed notes is bad is a bit hypocritical since you fall in that same category (of user contributions).  I think it&#039;s good to point out errors, but to tell people to &quot;beware of user contributed notes&quot; in general is an extremely bad philosophy.</description>
		<content:encoded><![CDATA[<p>To say that user contributed notes is bad is a bit hypocritical since you fall in that same category (of user contributions).  I think it&#8217;s good to point out errors, but to tell people to &#8220;beware of user contributed notes&#8221; in general is an extremely bad philosophy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ray Paseur</title>
		<link>http://www.brandonsavage.net/be-wary-of-user-contributed-notes/#comment-2246</link>
		<dc:creator>Ray Paseur</dc:creator>
		<pubDate>Mon, 23 Nov 2009 13:27:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=1045#comment-2246</guid>
		<description>I think there are some Julian Date functions that span long periods of time with fairly consistent date results.  But a problem that lurks in any of these date questions is the foundation calendar.  Over human history it has changed a few times, and that can leave us with odd questions.  Was Jesus really crucified on Friday, for example?  As a matter of faith the answer is Yes, however as a matter of historical calendar record, the answer is less clear.  I completely agree with the comment from Andris - the PHP community can, and should, police its user-contributed notes.  Something more like a wiki comes to mind.</description>
		<content:encoded><![CDATA[<p>I think there are some Julian Date functions that span long periods of time with fairly consistent date results.  But a problem that lurks in any of these date questions is the foundation calendar.  Over human history it has changed a few times, and that can leave us with odd questions.  Was Jesus really crucified on Friday, for example?  As a matter of faith the answer is Yes, however as a matter of historical calendar record, the answer is less clear.  I completely agree with the comment from Andris &#8211; the PHP community can, and should, police its user-contributed notes.  Something more like a wiki comes to mind.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://www.brandonsavage.net/be-wary-of-user-contributed-notes/#comment-2243</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Mon, 23 Nov 2009 13:15:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=1045#comment-2243</guid>
		<description>&lt;blockquote&gt;I&#039;m not sure why you get a 1 from his function; you shouldn&#039;t. My function, on the other hand, on a 64-bit system, works 100% properly under PHP 5.3.&lt;/blockquote&gt;

For dates beyond 1000 weeks ago (beyond 24 Sep 1990 at the time of writing this), all return values will be 1. This is because the $days_rest_count calculation results in 0 for those dates.  Perhaps if the note author gave a reasoning for choosing this over any other method of generating the week day, their particularly convoluted approach might make sense. Or perhaps not.</description>
		<content:encoded><![CDATA[<blockquote><p>I&#8217;m not sure why you get a 1 from his function; you shouldn&#8217;t. My function, on the other hand, on a 64-bit system, works 100% properly under PHP 5.3.</p></blockquote>
<p>For dates beyond 1000 weeks ago (beyond 24 Sep 1990 at the time of writing this), all return values will be 1. This is because the $days_rest_count calculation results in 0 for those dates.  Perhaps if the note author gave a reasoning for choosing this over any other method of generating the week day, their particularly convoluted approach might make sense. Or perhaps not.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brandon Savage</title>
		<link>http://www.brandonsavage.net/be-wary-of-user-contributed-notes/#comment-2242</link>
		<dc:creator>Brandon Savage</dc:creator>
		<pubDate>Mon, 23 Nov 2009 11:11:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=1045#comment-2242</guid>
		<description>I actually DID test it, and here are the results that I got:

&lt;div class=&quot;example&quot;&gt;
$date1 = &#039;2009-11-23&#039;;
$date2 = &#039;1940-11-23&#039;;
$date3 = &#039;2040-11-23&#039;;
$date4 = &#039;2009-12-25&#039;;

echo $date1 . &#039; Theirs: &#039; . return_day_of_week($date1) . &#039;Mine: &#039; . getDayOfWeek($date1) . &#039;&#039;;
echo $date2 . &#039; Theirs: &#039; . return_day_of_week($date2) . &#039;Mine: &#039; . getDayOfWeek($date2) . &#039;&#039;;
echo $date3 . &#039; Theirs: &#039; . return_day_of_week($date3) . &#039;Mine: &#039; . getDayOfWeek($date3) . &#039;&#039;;
echo $date4 . &#039; Theirs: &#039; . return_day_of_week($date4) . &#039;Mine: &#039; . getDayOfWeek($date4) . &#039;&#039;;
&lt;/div&gt;

Results:
&lt;div class=&quot;example&quot;&gt;
2009-11-23
Theirs: 1
Mine: 1

1940-11-23
Theirs: 1
Mine: 6

2040-11-23
Theirs: 1
Mine: 5

2009-12-25
Theirs: 3
Mine: 5
&lt;/div&gt;

I&#039;m not sure why you get a 1 from his function; you shouldn&#039;t. My function, on the other hand, on a 64-bit system, works 100% properly under PHP 5.3.</description>
		<content:encoded><![CDATA[<p>I actually DID test it, and here are the results that I got:</p>
<div class="example">
$date1 = &#8217;2009-11-23&#8242;;<br />
$date2 = &#8217;1940-11-23&#8242;;<br />
$date3 = &#8217;2040-11-23&#8242;;<br />
$date4 = &#8217;2009-12-25&#8242;;</p>
<p>echo $date1 . &#8216; Theirs: &#8216; . return_day_of_week($date1) . &#8216;Mine: &#8216; . getDayOfWeek($date1) . &#8221;;<br />
echo $date2 . &#8216; Theirs: &#8216; . return_day_of_week($date2) . &#8216;Mine: &#8216; . getDayOfWeek($date2) . &#8221;;<br />
echo $date3 . &#8216; Theirs: &#8216; . return_day_of_week($date3) . &#8216;Mine: &#8216; . getDayOfWeek($date3) . &#8221;;<br />
echo $date4 . &#8216; Theirs: &#8216; . return_day_of_week($date4) . &#8216;Mine: &#8216; . getDayOfWeek($date4) . &#8221;;
</p></div>
<p>Results:</p>
<div class="example">
2009-11-23<br />
Theirs: 1<br />
Mine: 1</p>
<p>1940-11-23<br />
Theirs: 1<br />
Mine: 6</p>
<p>2040-11-23<br />
Theirs: 1<br />
Mine: 5</p>
<p>2009-12-25<br />
Theirs: 3<br />
Mine: 5
</p></div>
<p>I&#8217;m not sure why you get a 1 from his function; you shouldn&#8217;t. My function, on the other hand, on a 64-bit system, works 100% properly under PHP 5.3.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Florian</title>
		<link>http://www.brandonsavage.net/be-wary-of-user-contributed-notes/#comment-2238</link>
		<dc:creator>Florian</dc:creator>
		<pubDate>Mon, 23 Nov 2009 08:59:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=1045#comment-2238</guid>
		<description>&gt;In programming, flaws can be dangerous, and so, developers should be wary, but not ignorant, of the user-contributed notes in documentation like the PHP manual.
What about the manual itself? Aren&#039;t we all users as well who contribute there? :)
User notes aren&#039;t just shown like posted, there&#039;s a team that has to review and explicitly approve them, just like people scanning commit notes to docs.</description>
		<content:encoded><![CDATA[<p>&gt;In programming, flaws can be dangerous, and so, developers should be wary, but not ignorant, of the user-contributed notes in documentation like the PHP manual.<br />
What about the manual itself? Aren&#8217;t we all users as well who contribute there? :)<br />
User notes aren&#8217;t just shown like posted, there&#8217;s a team that has to review and explicitly approve them, just like people scanning commit notes to docs.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maarten</title>
		<link>http://www.brandonsavage.net/be-wary-of-user-contributed-notes/#comment-2236</link>
		<dc:creator>Maarten</dc:creator>
		<pubDate>Mon, 23 Nov 2009 07:50:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=1045#comment-2236</guid>
		<description>If you&#039;re running a new enough PHP check out http://www.php.net/manual/en/datetime.format.php to implement something similar in less code then the contributors&#039; note.
I only just discovered that PHP had that functionality (and it hasn&#039;t been there for a very long time afaik) but it&#039;s a lot nicer then having to work around the 1901-2038 problem using external classes/functions.</description>
		<content:encoded><![CDATA[<p>If you&#8217;re running a new enough PHP check out <a href="http://www.php.net/manual/en/datetime.format.php" rel="nofollow">http://www.php.net/manual/en/datetime.format.php</a> to implement something similar in less code then the contributors&#8217; note.<br />
I only just discovered that PHP had that functionality (and it hasn&#8217;t been there for a very long time afaik) but it&#8217;s a lot nicer then having to work around the 1901-2038 problem using external classes/functions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andris</title>
		<link>http://www.brandonsavage.net/be-wary-of-user-contributed-notes/#comment-2235</link>
		<dc:creator>Andris</dc:creator>
		<pubDate>Mon, 23 Nov 2009 07:33:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=1045#comment-2235</guid>
		<description>Maybe some voting system would be in order? That way the most useful comments (that get many upvotes) would be on top. Or maybe let the comments be handled by a 3d party, something like stackoverflow.com for example.</description>
		<content:encoded><![CDATA[<p>Maybe some voting system would be in order? That way the most useful comments (that get many upvotes) would be on top. Or maybe let the comments be handled by a 3d party, something like stackoverflow.com for example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ivo</title>
		<link>http://www.brandonsavage.net/be-wary-of-user-contributed-notes/#comment-2234</link>
		<dc:creator>Ivo</dc:creator>
		<pubDate>Mon, 23 Nov 2009 07:28:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonsavage.net/?p=1045#comment-2234</guid>
		<description>You judge too hastily. The contributor is aware of date(&quot;w&quot;), he&#039;s using it in his code AND he mentioned it in his comment (but you only showed the code). date(&quot;w&quot;) works from 1901 to 2038. The code this contributor wrote supposedly (I haven&#039;t tested it) works for dates before and beyond that.</description>
		<content:encoded><![CDATA[<p>You judge too hastily. The contributor is aware of date(&#8220;w&#8221;), he&#8217;s using it in his code AND he mentioned it in his comment (but you only showed the code). date(&#8220;w&#8221;) works from 1901 to 2038. The code this contributor wrote supposedly (I haven&#8217;t tested it) works for dates before and beyond that.</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)
Database Caching 4/11 queries in 0.004 seconds using disk: basic
Content Delivery Network via Amazon Web Services: S3: files.brandonsavage.net.s3.amazonaws.com

Served from: www.brandonsavage.net @ 2012-02-07 04:37:09 -->
