<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bin-Blog &#187; principle</title>
	<atom:link href="http://www.bin-co.com/blog/tag/principle/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bin-co.com/blog</link>
	<description>Learn about the latest in Web Development - as soon as I do.</description>
	<lastBuildDate>Tue, 13 Oct 2009 18:55:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>10 Principals of PHP Development</title>
		<link>http://www.bin-co.com/blog/2008/09/10-principals-of-php-development/</link>
		<comments>http://www.bin-co.com/blog/2008/09/10-principals-of-php-development/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 19:04:53 +0000</pubDate>
		<dc:creator>Binny V A</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[master]]></category>
		<category><![CDATA[practice]]></category>
		<category><![CDATA[principle]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.bin-co.com/blog/?p=122</guid>
		<description><![CDATA[My take on the recent '<a href="http://nettuts.com/articles/10-principles-of-the-php-masters/">10 Principles of the PHP Masters</a>' article. Bottom line - go read it - and decide which advices are good for you.]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.bin-co.com/blog/wp-content/uploads/2008/09/php-logo.png" alt="PHP Logo" title="PHP Logo Custom" width="179" height="98" class="alignnone size-full wp-image-123 intro" align="right" /></p>
<p class="intro">Are you a PHP developer? Go read the article &#8216;<a href="http://nettuts.com/articles/10-principles-of-the-php-masters/">10 Principles of the PHP Masters</a>&#8216;. Do you want to learn PHP? Go read it. </p>
<blockquote><p>With PHP&#8217;s widespread adoption,it&#8217;s almost too easy to find a script or snippet to do exactly what you need. Unfortunately, there&#8217;s no filter as to what is a &#8220;good practice&#8221; and what&#8217;s, well&#8230; not so good when writing a PHP script. We need trustworthy sources, who have proven they have a solid grasp on the best practices of PHP.</p></blockquote>
<h2>Use PHP Only When You Need it</h2>
<p>Rasmus Lerdorf</p>
<p><a href="http://www.oracle.com/technology/pub/articles/php_experts/rasmus_php.html">PHP was designed for Web Development</a> &#8211; and its very good at it. Just because you can use it to create desktop apps don&#8217;t mean that you have to.</p>
<h2>Use Many Tables With PHP and MYSQL for Scalability</h2>
<p>Matt Mullenweg</p>
<p>This advice comes from a rather controversial <a href="http://ma.tt/2006/03/wordpress-and-lyceum/">database design choice he made when creating WordPress MU</a>. It created separate tables for each blog rather than the usual method.</p>
<h2>Never, ever trust your users</h2>
<p>Dave Child</p>
<p><a href="http://www.addedbytes.com/php/writing-secure-php/">Validate everything</a> that comes from the user. Yeah, I know its boring &#8211; but it must be done.</p>
<h2>Invest in PHP Caching</h2>
<p>Ben Balbo</p>
<p><a href="http://www.sitepoint.com/article/caching-php-performance/">Caching is very important</a> if you have a busy site.</p>
<h2>Speed up PHP Development with an IDE, Templates and Snippets</h2>
<p>Chad Kieffer</p>
<p>I find it a bit hard to support this. Yeah <a href="http://2tbsp.com/node/104">IDEs speed up development</a> &#8211; a small bit. About Snippets &#8211; use them if you trust the source.</p>
<p>But if you really want to speed up development, </p>
<ul>
<li>Use a framework(coming up later)</li>
<li>Invest in code generation.</li>
</ul>
<h2>Make Better Use of PHP&#8217;s Filter Functions</h2>
<p>Joey Sochacki</p>
<p>This is actually new to me &#8211; but I am going to try this out.</p>
<blockquote><p><a href="http://devolio.com/blog/archives/413-Data-Filtering-Using-PHPs-Filter-Functions-Part-one.html">Filtering data</a>. We all have to do it. Most, if not all of us, despise doing it. However, unbeknown to most are PHP&#8217;s filter_* functions, that allow us to do all sorts of filtering and validation. Using PHP&#8217;s filter_* functions, we can validate and sanitize data types, URLs, e-mail addresses, IP addresses, strip bad characters, and more, all with relative ease.</p></blockquote>
<h2>Use a PHP Framework</h2>
<p>Josh Sharp</p>
<p>This is one thing that really speed up development. Also, the programmers that have to maintain your programs will thank you for it.</p>
<h2>Don&#8217;t use a PHP Framework</h2>
<p>Rasmus Lerdorf</p>
<p>The basic argument is that <a href="http://szeged2008.drupalcon.org/program/sessions/rasmus-lerdorf-keynote-simple-hard">Frameworks slow things down</a>. Keep that in mind when your choosing a framework.</p>
<h2>Use Batch Processing</h2>
<p>Jack D. Herrington</p>
<p>This refers to the tasks that can processed in the background &#8211; Herrington recommends <a href="http://www.ibm.com/developerworks/opensource/library/os-php-batch/">using batch processing and cron</a> here. As most of you are aware, PHP don&#8217;t have threads &#8211; and it don&#8217;t matter to me. You don&#8217;t use threads when serving a web page. But in  cases like these, threads come in handy.</p>
<p>My advice? Use Python or some other language that has threads to do do the job for you &#8211; you don&#8217;t have to do everything in PHP.</p>
<h2>Turn on Error Reporting Immediately</h2>
<p>David Cummings</p>
<p>This is very important when developing the app &#8211; <a href="http://www.sitepoint.com/article/quick-php-tips/">error reporting lets you find future bugs</a>. Make sure they are on.</p>
<p>And just as important is the fact that you should turn them off in the production system &#8211; you don&#8217;t want your users seeing your error messages.</p>
<h2>Related Links</h2>
<ul>
<li><a href="http://nettuts.com/html-css-techniques/10-principles-of-the-css-masters/">10 Principles of CSS Masters</a></li>
<li><a href="http://www.phpdeveloper.org/news/10989">NETTUTS.com: 10 Principles of the PHP Masters</a></li>
<li><a href="http://ifacethoughts.net/2008/09/10/principles-for-php-programming/">Principles For PHP Programming</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.bin-co.com/blog/2008/09/10-principals-of-php-development/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

