<?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/"
		>
<channel>
	<title>Comments on: 5 Tips for Writing Cleaner PHP Code</title>
	<atom:link href="http://www.ultramegatech.com/blog/2009/06/5-tips-for-writing-cleaner-php-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ultramegatech.com/blog/2009/06/5-tips-for-writing-cleaner-php-code/</link>
	<description>Web development blog from UltraMega Tech.</description>
	<lastBuildDate>Wed, 10 Mar 2010 19:09:15 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Steve</title>
		<link>http://www.ultramegatech.com/blog/2009/06/5-tips-for-writing-cleaner-php-code/comment-page-1/#comment-1125</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Mon, 01 Feb 2010 18:18:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.ultramegatech.com/blog/?p=406#comment-1125</guid>
		<description>Those are some good points. I have just always used constants with a unique prefix for configuration directives without problems. Though storing configuration in a class is a great idea, and safer since it doesn&#039;t pollute the global namespace. Maybe I&#039;ll write a follow up post about that. Thanks for the comment.</description>
		<content:encoded><![CDATA[<p>Those are some good points. I have just always used constants with a unique prefix for configuration directives without problems. Though storing configuration in a class is a great idea, and safer since it doesn&#8217;t pollute the global namespace. Maybe I&#8217;ll write a follow up post about that. Thanks for the comment.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PHPGangsta</title>
		<link>http://www.ultramegatech.com/blog/2009/06/5-tips-for-writing-cleaner-php-code/comment-page-1/#comment-1124</link>
		<dc:creator>PHPGangsta</dc:creator>
		<pubDate>Mon, 01 Feb 2010 01:29:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.ultramegatech.com/blog/?p=406#comment-1124</guid>
		<description>I read number 4 and I&#039;m not sure if this is a really good tip. I perhaps would be a bit more precise and say &quot;class constant&quot; or something like that, because I personally hate global variables and global constants. And I think avoiding global variables and constants is one of the tips to good programmers, too.

Also global constants are a problem if you use/integrate another project, and this code also defines a constant named &quot;DB_NAME&quot; as your project does. This could be a problem then.

Reusing the code is also difficult if your code relies on global constants.

If you want an array or an object as a constant, that is not possible. So the best solution perhaps is a class with attributes that you cannot change (only __get()), then you are much more flexible I think.

See for example this nice examples:
http://www.benlog.org/2008/1/24/php-be-careful-with-global-constants/</description>
		<content:encoded><![CDATA[<p>I read number 4 and I&#8217;m not sure if this is a really good tip. I perhaps would be a bit more precise and say &#8220;class constant&#8221; or something like that, because I personally hate global variables and global constants. And I think avoiding global variables and constants is one of the tips to good programmers, too.</p>
<p>Also global constants are a problem if you use/integrate another project, and this code also defines a constant named &#8220;DB_NAME&#8221; as your project does. This could be a problem then.</p>
<p>Reusing the code is also difficult if your code relies on global constants.</p>
<p>If you want an array or an object as a constant, that is not possible. So the best solution perhaps is a class with attributes that you cannot change (only __get()), then you are much more flexible I think.</p>
<p>See for example this nice examples:<br />
<a href="http://www.benlog.org/2008/1/24/php-be-careful-with-global-constants/" rel="nofollow">http://www.benlog.org/2008/1/24/php-be-careful-with-global-constants/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: UltraMega</title>
		<link>http://www.ultramegatech.com/blog/2009/06/5-tips-for-writing-cleaner-php-code/comment-page-1/#comment-101</link>
		<dc:creator>UltraMega</dc:creator>
		<pubDate>Sun, 02 Aug 2009 20:43:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.ultramegatech.com/blog/?p=406#comment-101</guid>
		<description>Yeah that was a typo. Fixed it. And yes, most of this should be common sense to anyone with some experience, but you never know...</description>
		<content:encoded><![CDATA[<p>Yeah that was a typo. Fixed it. And yes, most of this should be common sense to anyone with some experience, but you never know&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: keogh</title>
		<link>http://www.ultramegatech.com/blog/2009/06/5-tips-for-writing-cleaner-php-code/comment-page-1/#comment-100</link>
		<dc:creator>keogh</dc:creator>
		<pubDate>Sun, 02 Aug 2009 20:25:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.ultramegatech.com/blog/?p=406#comment-100</guid>
		<description>Good post! only one thing, I think that you misspelled at &quot;[..]Keep everything as sort as possible...&quot; don&#039;t you want to mean &#039;short&#039; instead of &#039;sort&#039;. Sort doesn&#039;t has any meaning to me on that sentence.

Eventhough it&#039;s a good post, I&#039;ve been applied all of these tips  from long time ago by common sense and experience with PHP programming, this is good for newbies!

Nice blog too!

Regards</description>
		<content:encoded><![CDATA[<p>Good post! only one thing, I think that you misspelled at &#8220;[..]Keep everything as sort as possible&#8230;&#8221; don&#8217;t you want to mean &#8217;short&#8217; instead of &#8217;sort&#8217;. Sort doesn&#8217;t has any meaning to me on that sentence.</p>
<p>Eventhough it&#8217;s a good post, I&#8217;ve been applied all of these tips  from long time ago by common sense and experience with PHP programming, this is good for newbies!</p>
<p>Nice blog too!</p>
<p>Regards</p>
]]></content:encoded>
	</item>
</channel>
</rss>
