<?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>CMI Web Studio</title>
	<atom:link href="http://www.cmiwebstudio.com/blog/?feed=rss2&#038;p=" rel="self" type="application/rss+xml" />
	<link>http://www.cmiwebstudio.com/blog</link>
	<description></description>
	<lastBuildDate>Tue, 07 Sep 2010 01:03:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Top 3 Productivity Tips for Web Development</title>
		<link>http://www.cmiwebstudio.com/blog/top-3-productivity-tips-for-web-development/</link>
		<comments>http://www.cmiwebstudio.com/blog/top-3-productivity-tips-for-web-development/#comments</comments>
		<pubDate>Tue, 07 Sep 2010 00:05:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General Web]]></category>

		<guid isPermaLink="false">http://www.cmiwebstudio.com/blog/?p=107</guid>
		<description><![CDATA[1. Switch Off Your Email and Cell Phone Email is a great tool, but it can easily dominate your working day. Most people will get more done by switching off email and actually working. If you find yourself jumping straight into action every time your mail client goes “ping!”, stopping whatever it is you’re doing, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>1. Switch Off Your Email and Cell Phone</strong></p>
<p>Email is a great tool, but it can easily dominate your working day.  Most people will get more done by switching off email and actually working.</p>
<p>If you find yourself jumping straight into action every time your mail client goes “ping!”, stopping whatever it is you’re doing, and going to see what the message is, you need to ask who’s boss in the relationship!</p>
<p>The truth is – most emails aren’t urgent.  You usually don’t have to respond straightaway. You usually don’t need to know about them straightaway. In fact, most emails are spent telling others what you&#8217;ll be working on&#8230; when you could have been actually working on it.  So, turn the thing off so that you can get some real work done!  </p>
<p>I give myself up to one hour in the morning to sort my new mail. Then it gets turned off until lunchtime, when I check it again. I’ll deal with lower-priority messages late in the day, when I’m perhaps more tired.</p>
<p>If you can’t bear to shut down your mail client, would you consider…</p>
<p>Turning off the message preview option?<br />
Turning off the audible alert?<br />
Setting your email only to collect once every hour?</p>
<p><strong>2. Ruthless Prioritisation</strong></p>
<p>What percentage of your day do you spend writing lists entitled “Things to do – Urgent!”?  Most people have more stuff to do than time to do it in.</p>
<p>We just need to accept it and move on to getting stuff done. If we worry about all the possible things you could do, you’ll end up not doing anything.</p>
<p>After years of list-writing on paper and whiteboards, colour-coded prioritisation in Outlook, calendar-fiddling etc., I’ve settled on a simple system of ruthless prioritisation.</p>
<p>Write down the things you are going to do that day, and put them in order, often putting the least appealing or most challenging stuff first (as I know I’ll feel better having done them).</p>
<p>I shut down Outlook and move on to 3&#8230; </p>
<p><strong>3. JUST DO IT!</strong></p>
<p>I’ve worked with a lot of clever processes in business and software development. The most useful of all is JDI.</p>
<p>If you’ve been ruthless about what needs to be done, there’s no more thinking to do. Any further energy or time spent on prioritisation is energy and time wasted. Prioritisation should take a few deep breaths, a dash of courage and a pencil.</p>
<p>As soon as you’ve done your list of things to do today, ignore items 2 onwards. Focus on item 1, and JDI.</p>
<p>Don’t worry about what’s next, be your own super-manager. You know the good team leaders who take all the pressure off you by saying, “This is all I want you to concentrate on right now.. Leave the rest to me.”? Be that guy for yourself! Tell yourself, “All you need to think about is Item 1. Forget about the rest.”</p>
<p>And JDI.</p>
<p>You’ll get more done that day, and you’ll be happier</p>
<p>When your mind is going hither and thither, discrimination will never be brought to a conclusion. With an intense, fresh and undelaying spirit, one will make his judgments within the space of seven breaths. It is a matter of being determined and having the spirit to break right through to the other side.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cmiwebstudio.com/blog/top-3-productivity-tips-for-web-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>12 Regular Expressions To Improve Your PHP Development</title>
		<link>http://www.cmiwebstudio.com/blog/12-regular-expressions-to-improve-your-php-development/</link>
		<comments>http://www.cmiwebstudio.com/blog/12-regular-expressions-to-improve-your-php-development/#comments</comments>
		<pubDate>Mon, 06 Sep 2010 23:11:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.cmiwebstudio.com/blog/?p=101</guid>
		<description><![CDATA[In programming, regular expressions are a very useful tool designed to validate, search, and match text patterns. In this article, I have compiled more than 10 incredibly useful regular expressions, for any language, that will probably be very beneficial to you. Validate an URL Is a particular url valid? The following regexp will let you [...]]]></description>
			<content:encoded><![CDATA[<p>In programming, regular expressions are a very useful tool designed to validate, search, and match text patterns. In this article, I have compiled more than 10 incredibly useful regular expressions, for any language, that will probably be very beneficial to you.</p>
<p><strong>Validate an URL</strong><br />
Is a particular url valid? The following regexp will let you know.</p>
<p>/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \?=.-]*)*\/?$/<br />
Source: http://snipplr.com/view/19502/validate-a-url/</p>
<p><strong>Validate US phone number</strong><br />
This regexp will verify that a US phone number is valid.</p>
<p>/^(\+\d)*\s*(\(\d{3}\)\s*)*\d{3}(-{0,1}|\s{0,1})\d{2}(-{0,1}|\s{0,1})\d{2}$/<br />
Source: http://snippets.dzone.com/posts/show/597</p>
<p><strong>Test if a password is strong</strong><br />
Weak passwords are one of the quickest ways to get hacked. The following regexp will make sure that:</p>
<p>Passwords will contain at least (1) upper case letter<br />
Passwords will contain at least (1) lower case letter<br />
Passwords will contain at least (1) number or special character<br />
Passwords will contain at least (8) characters in length<br />
Password maximum length should not be arbitrarily limited</p>
<p><strong>Get code within <?php and ?></strong><br />
(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$<br />
Source: http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=297</p>
<p><strong>Get code within</strong><br />
If for some reason you need to grab all the code contained within the  tags, this regexp will do the job:</p>
<p>&lt;\?[php]*([^\?&gt;]*)\?&gt;<br />
Source: http://snipplr.com/view/12845/get-all-the-php-code-between/</p>
<p><strong>Match tel: urls</strong><br />
In a recent post, I showed you how you can use iPhone special link prfixes to automatically call someone.<br />
This regular expression will match those tel: urls.</p>
<p>^tel:((?:\+[\d().-]*\d[\d().-]*|[0-9A-F*#().-]*[0-9A-F*#][0-9A-F*#().-]*(?:;[a-z\d-]+(?:=(?:[a-z\d\[\]\/:&amp;+$_!~*&#8217;().-]|%[\dA-F]{2})+)?)*;phone-context=(?:\+[\d().-]*\d[\d().-]*|(?:[a-z0-9]\.|[a-z0-9][a-z0-9-]*[a-z0-9]\.)*(?:[a-z]|[a-z][a-z0-9-]*[a-z0-9])))(?:;[a-z\d-]+(?:=(?:[a-z\d\[\]\/:&amp;+$_!~*&#8217;().-]|%[\dA-F]{2})+)?)*(?:,(?:\+[\d().-]*\d[\d().-]*|[0-9A-F*#().-]*[0-9A-F*#][0-9A-F*#().-]*(?:;[a-z\d-]+(?:=(?:[a-z\d\[\]\/:&amp;+$_!~*&#8217;().-]|%[\dA-F]{2})+)?)*;phone-context=\+[\d().-]*\d[\d().-]*)(?:;[a-z\d-]+(?:=(?:[a-z\d\[\]\/:&amp;+$_!~*&#8217;().-]|%[\dA-F]{2})+)?)*)*)$<br />
Source: http://tools.ietf.org/html/rfc3966#section-3</p>
<p><strong>Validate US zip code</strong><br />
When building a registration form, it is common to ask the user’s zip code. As forms are often boring, there’s a strong chance that the user will try to register false data. This regular expression will make sure he entered a valid American zip code.</p>
<p>^[0-9]{5}(-[0-9]{4})?$<br />
Source: http://reusablecode.blogspot.com/2008/08/isvalidzipcode.html</p>
<p><strong>Validate Canadian postal code</strong><br />
This regexp is very similar to the previous one, but it will match Canadian postal codes instead.</p>
<p>^[ABCEGHJ-NPRSTVXY]{1}[0-9]{1}[ABCEGHJ-NPRSTV-Z]{1}[ ]?[0-9]{1}[ABCEGHJ-NPRSTV-Z]{1}[0-9]{1}$<br />
Source: http://reusablecode.blogspot.com/2008/08/isvalidpostalcode.html</p>
<p><strong>Grab unclosed img tags</strong><br />
As you probably know, the xhtml standard requires all tags to be properly closed. This regular expression will search for unclosed img tags. It could be easily modified to grab any other unclosed html tags.</p>
<p>]+)(\s*[^\/])&gt;<br />
Source: http://snipplr.com/view/6632/grab-any-unclosed-xhtml-img-tags/</p>
<p><strong>Find all CSS attributes</strong><br />
This regexp will find CSS attributes, such as background:red; or padding-left:25px;.</p>
<p>\s(?[a-zA-Z-]+)\s[:]{1}\s*(?[a-zA-Z0-9\s.#]+)[;]{1}<br />
Source: http://snipplr.com/view/17903/find-css-attributes/</p>
<p><strong>Validate an IBAN</strong><br />
I have recently worked on a banking application and this one was definitely a life-saver. It will verify that the given IBAN is valid.</p>
<p>[a-zA-Z]{2}[0-9]{2}[a-zA-Z0-9]{4}[0-9]{7}([a-zA-Z0-9]?){0,16}<br />
Source: http://snipplr.com/view/15322/iban-regex-all-ibans/</p>
<p><strong>Validate a BIC code</strong><br />
Another one very useful for any banking application or website: This regexp will validate a BIC code.</p>
<p>([a-zA-Z]{4}[a-zA-Z]{2}[a-zA-Z0-9]{2}([a-zA-Z0-9]{3})?)<br />
Source: http://snipplr.com/view/15320/bic-bank-identifier-code-regex/</p>
<p>If you’re interested in regular expressions, make sure you have read our “<a href="http://www.catswhocode.com/blog/15-php-regular-expressions-for-web-developers">15 PHP regular expression for developers</a>” post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cmiwebstudio.com/blog/12-regular-expressions-to-improve-your-php-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web 3.0 &#8211; Everything As You Know It Will Change</title>
		<link>http://www.cmiwebstudio.com/blog/everything-as-you-know-it-will-change/</link>
		<comments>http://www.cmiwebstudio.com/blog/everything-as-you-know-it-will-change/#comments</comments>
		<pubDate>Sat, 14 Aug 2010 06:36:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General Web]]></category>

		<guid isPermaLink="false">http://www.cmiwebstudio.com/blog/?p=98</guid>
		<description><![CDATA[Yes, if you&#8217;ve been keeping up, I&#8217;ve been preaching for several years now about Web 3.0. When I mention it, I usually get a look like a dog hearing a high pitched whistle. In fact, this might be the first place you&#8217;ve ever heard of this concept, so the reactions can be expected. Well, life [...]]]></description>
			<content:encoded><![CDATA[<p>Yes, if you&#8217;ve been keeping up, I&#8217;ve been preaching for several years now about Web 3.0.  When I mention it, I usually get a look like a dog hearing a high pitched whistle.  In fact, this might be the first place you&#8217;ve ever heard of this concept, so the reactions can be expected. Well, life as we know it in technology will be changing.  In fact, we&#8217;re already seeing this change starting to take place.  The fact is, once the global internet infrastructure can handle the demands of the what will be the biggest impact to technology since the computer itself, everything as you know it will change.  Your daily life.  Your daily routines.  The way you interface and retrieve data.  You&#8217;ve seen nothing yet.</p>
<p>Let&#8217;s take a look at some basic examples already following this inevitable future.</p>
<p>Browser-based Everything</p>
<p>Google is developing a variety of applications and programs that exist entirely within the browser. Their PAC-MAN game was a preview of what’s to come because it allowed in-browser play of a simple, lightweight video game that required no downloads and relied on pure HTML, CSS, and Javascript. At the company’s 2010 I/O conference, Google laid out its plans to develop “rich multimedia applications that operate within the browser” (according to this New York Times report on the conference). The company plans to sell in-browser web applications like photo editing software (imagine using a Photoshop equivalent entirely within the browser) that it will sell in a web applications store called the Chrome Web Store.</p>
<p>If our programs and applications are about to be folded into the browser, what will exist within the browser in ten years? Currency? Education? Consciousness? Why will anyone buy standalone computer software?  They won&#8217;t.  Our entire world will live and breath in a streaming real-time global internet infrastructure.  Get ready&#8230; </p>
]]></content:encoded>
			<wfw:commentRss>http://www.cmiwebstudio.com/blog/everything-as-you-know-it-will-change/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adobe Dreamweavers Future For Developers</title>
		<link>http://www.cmiwebstudio.com/blog/adobe-dreamweavers-future-for-developers/</link>
		<comments>http://www.cmiwebstudio.com/blog/adobe-dreamweavers-future-for-developers/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 22:13:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General Web]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Dreamweaver]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.cmiwebstudio.com/blog/?p=91</guid>
		<description><![CDATA[OK, Dreamweaver has reused the recordset code for too long, but let&#8217;s look at the big picture for Dreamweaver CS5. The easiest front end development tool that exists&#8230; period. No one can take that away. In CS5, Adobe has finally stepped up their development game a notch. As a PHP developer, it’s the changes in [...]]]></description>
			<content:encoded><![CDATA[<p>OK, Dreamweaver has reused the recordset code for too long, but let&#8217;s look at the big picture for Dreamweaver CS5.  The easiest front end development tool that exists&#8230; period.  No one can take that away.  In CS5, Adobe has finally stepped up their development game a notch.</p>
<p>As a PHP developer, it’s the changes in Code view that really excite me. When you start typing a PHP script in Dreamweaver CS5, you’ll immediately notice a red marker in the line numbers column and an alert about a syntax error. Complete the line without errors, and the marker and warning disappear. Dreamweaver constantly checks your syntax on the fly. It doesn’t tell you what the errors are, but it highlights all lines with errors, making the debugging process much quicker. PHP code hints have also been improved dramatically. There’s full support for all core functions, constants, and classes (as of PHP 5.2).</p>
<p>Code hinting is also much smarter. Instead of needing to search through code hints alphabetically, Dreamweaver CS5 searches for substrings. This is helpful when you can’t remember the exact name of function or class—just type the part of the name that you remember, and Dreamweaver includes it in the list. You can also work out your own shortcuts. For example, if you press Ctrl+spacebar and type gesi, the code hints take you straight to getimagesize() by recognizing the ge of “image” and the si of “size”. And in case you don’t know how a function or class works, the official manual page—complete with code examples—appears as a tooltip at the bottom of the selected code hint.</p>
<p>For serious PHP developers, it gets even better. Dreamweaver CS5 is capable of code introspection, so it builds code hints on the fly for your own functions and classes, as well as for third-party libraries, such as the Zend Framework. The definition files don’t even need to be directly attached to the page you’re working in. With Site-Specific Code Hints, you tell Dreamweaver where your library files are located, and it scans them for you automatically.</p>
<p>So should you upgrade?  Seriously, you&#8217;re asking that?  YES&#8230; it&#8217;s the best version of Dreamweaver that&#8217;s existed.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.cmiwebstudio.com/blog/adobe-dreamweavers-future-for-developers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Untold Truth About PHP Programming &#8211; OO if you want slow and Pretty, Procedural if you want fast and profits</title>
		<link>http://www.cmiwebstudio.com/blog/the-untold-truth-about-php-programming/</link>
		<comments>http://www.cmiwebstudio.com/blog/the-untold-truth-about-php-programming/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 21:02:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.cmiwebstudio.com/blog/?p=75</guid>
		<description><![CDATA[The concept of object oriented programming is great. The application is even better. But like all philosophically powerful abstract concepts, object oriented programming generally takes longer to develop from scratch, cost more money for all parties involved to develop unless you&#8217;re reusing a large portion of past project code, and in almost all cases, will [...]]]></description>
			<content:encoded><![CDATA[<p>The concept of object oriented programming is great. The application is even better. But like all philosophically powerful abstract concepts, object oriented programming generally takes longer to develop from scratch, cost more money for all parties involved to develop unless you&#8217;re reusing a large portion of past project code, and in almost all cases, will execute slower day to day than code written in a procedural fashion.</p>
<p>Wait, it get&#8217;s even more complicated&#8230;<br />
Most business applications are mission, time and budget driven. Therefore, the chances that the business will spend extra money for quality code that can have a longer extensible life (which usually doesn’t mean much to a business man) to choose the object oriented methodology are slim to none. This is the reason why most software houses develop code using procedural methodologies with PHP that are grinding sites out daily.</p>
<p>So if you&#8217;re developing the next open source flavor of the month you&#8217;re hoping will turn into a wordpress or magento&#8230; then you have to use OO.  But for the other 99% of clients that want a website with perhaps content management, you might want to rethink things. There are several other factors to consider, but the table below should give you a very basic idea of how this works.</p>
<p>The following is a very brief, and by no means fully comprehensive, list of characteristics to consider when building applications with PHP 5 under either of the methodologies:<br />
</p>
<table border="2" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top"><strong> </strong></td>
<td valign="top"><strong>Procedural PHP</strong></td>
<td valign="top"><strong>Object Oriented PHP</strong></td>
</tr>
<tr>
<td valign="top">Budget</td>
<td valign="top">Tight</td>
<td valign="top">Not so tight</td>
</tr>
<tr>
<td valign="top">Timeline</td>
<td valign="top">Tight</td>
<td valign="top">Not so tight</td>
</tr>
<tr>
<td valign="top">Will need to develop APIs / Web Services for other parties to interact with application</td>
<td valign="top">Not necessarily</td>
<td valign="top">Yes</td>
</tr>
<tr>
<td valign="top">Application Speed is Critical</td>
<td valign="top">Yes, it is of utmost priority</td>
<td valign="top">Speed can be sacrificed for quality of code</td>
</tr>
<tr>
<td width="205" valign="top">Time available for good documentation</td>
<td width="205" valign="top">If it is well documented, procedural code is not that difficult to follow</td>
<td width="205" valign="top">Documentation helps, but independence of objects doesn’t make it as critical as in the case of procedural</td>
</tr>
<tr>
<td valign="top">Independence of data and structure</td>
<td valign="top">Somewhat critical</td>
<td valign="top">Vital</td>
</tr>
<tr>
<td valign="top">Adaptability of code</td>
<td valign="top">Medium</td>
<td valign="top">Highly adaptable</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.cmiwebstudio.com/blog/the-untold-truth-about-php-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OO versus Procedural Programming in PHP</title>
		<link>http://www.cmiwebstudio.com/blog/oo-versus-procedural-programming-in-php/</link>
		<comments>http://www.cmiwebstudio.com/blog/oo-versus-procedural-programming-in-php/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 16:34:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.cmiwebstudio.com/blog/?p=67</guid>
		<description><![CDATA[In PHP, unlike many other languages, you can choose between using an object oriented (OO) or a procedural approach. Most PHP programmers use a procedural approach by default, since web pages themselves operate in a very procedural way (this tag, then this tag, then this tag). Interspersing procedural code with HTML is more straightforward, and [...]]]></description>
			<content:encoded><![CDATA[<p>In PHP, unlike many other languages, you can choose between using an object oriented (OO) or a procedural approach. Most PHP programmers use a procedural approach by default, since web pages themselves operate in a very procedural way (this tag, then this tag, then this tag). Interspersing procedural code with HTML is more straightforward, and so PHP programmers often develop their own style, based on this approach.</p>
<p>If you are new to PHP, procedural programming is probably the only kind of programming you are familiar with. However, if you have been exploring the PHP community for best practices, by now you have probably seen posts in forums and newsgroups about &#8220;object bloat&#8221;. You have probably also seen tutorials on how to write object oriented code in PHP. You may have downloaded libraries that employ classes, and learned to instantiate their objects and use their methods. Yet it is quite possible that you have never really understood when, where, or why it is appropriate to use an object oriented approach.</p>
<p>There is a certain amount of ranting on both sides of the issue, and slogans such as &#8220;Objects are bad!&#8221; or &#8220;Objects are good!&#8221; are sometimes heard. This article does not attempt to decide between the two approaches and come up with a single &#8220;best practice&#8221;, but to explore the advantages and disadvantages of each.</p>
<p>Here is an example of a procedural program:</p>
<p>&lt;?php<br />
print &#8220;Hello, world.&#8221;;<br />
?&gt;</p>
<p>Here is an example of an object-oriented program that achieves the same objective:</p>
<p>&lt;?php<br />
class helloWorld {<br />
function myPrint() {<br />
print &#8220;Hello, world.&#8221;;<br />
}<br />
}<br />
$myHelloWorld = new helloWorld();<br />
$myHelloWorld-&gt;myPrint();<br />
?&gt;</p>
<p>Who Writes Code Like This?<br />
In order to understand why this issue has become the subject of flame wars, let&#8217;s examine some extreme examples from both ends of the spectrum. First we&#8217;ll look at &#8220;the Procedural Fanatic&#8221; and then at &#8220;the Object Fanatic&#8221;. See if any of this sounds familiar.</p>
<p>The Procedural Fanatic<br />
The Procedural Fanatic was criticized by his computer science teacher for not using a more abstract approach. His argument, &#8220;But it works!&#8221;, didn&#8217;t improve his grade. Later, he went on to a career writing drivers, file systems, packetizers and other low-level programs, where his focus on speed and terseness gained him recognition.</p>
<p>Extreme examples of the Procedural Fanatic go a step beyond rejecting objects, and criticize abstraction itself. They are always looking for ways to make things faster, and don&#8217;t care if nobody else can read their code. Often, they consider programming a competitive rather than a team activity. They like to enter obfuscated code contests. Their favorite languages besides PHP are C and Assembler. In the PHP world they might write PECL modules, contributing code that is efficient.</p>
<p>The Objects Fanatic<br />
The Objects Fanatic recently discovered object oriented programming and is eager to put it to use &#8211; everywhere! The Objects Fanatic doesn&#8217;t really understand the performance considerations behind his approach. It sometimes seems that he enjoys abstract design concepts more than actual code. He probably has a career in project management or documentation.</p>
<p>Objects Fanatics are quick to point out to the proceduralists that without abstraction we&#8217;d all still be using ones and zeroes. They are known to speak in pseudocode. Extreme examples of Object Fanatics go beyond coding on objects at the expense of performance &#8211; they do it at the expense of elegance and even readability. Their favorite language besides PHP is Java or Smalltalk. In the PHP world, they may write PEAR modules, contributing code that is well documented and easy to maintain.</p>
<p>And Never The Twain Shall Meet<br />
Can you understand why forums are chock full of biased viewpoints? Your experiences, and the resulting philosophies you adopt, color your approach to new ideas. As programmers, we must constantly be aware of these prejudices and remain open to learning new things. As computer scientists, we must learn to set these prejudices aside and find the best methods for a given situation.</p>
<p>When Is Each Approach Useful?<br />
We have looked at which directives are best served by each approach individually. We have also explored some practical examples of real programs that use each type of programming effectively. But what happens when you have multiple directives?</p>
<p>Here is my advice:</p>
<p>Consider your directives.<br />
Become aware of your theoretical biases.<br />
Test out your assumptions.</p>
<p>Generic benchmarking reports of generic examples in object oriented and procedural fashion tell you very little about what to expect in your own unique application. Instead, find a benchmarking approach that you like, and use it to check whether you are actually fulfilling the directive of writing code that runs fast. Examine the functions that you are writing to see whether they need to share common data. Think whether there would ever be a case for extending them. Consider whether writing a class would be conducive to making your code extendable.</p>
<p>Above all, consider your directives on a scale. Weigh them out. By taking a practical, project-by-project approach to evaluating the usefulness of object oriented versus procedural programming you ensure a sober, informed decision. And remember, with PHP you always have a choice. You can even mix and match.</p>
<p>Summary<br />
Hopefully this article has given you a greater appreciation for the usefulness of each of the two programming approaches, and &#8211; more importantly &#8211; armed you with enough information and interest to explore these issues in greater detail. I hope that you will think for yourself, examining your project directives, checking out more real-world examples, and taking the good, bad, and ugly comments you sometimes hear about this topic with a grain of salt. Both approaches have their own advantages. So get out there and write some code!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cmiwebstudio.com/blog/oo-versus-procedural-programming-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Never Use $_GET Again&#8230; SAY WHAT?</title>
		<link>http://www.cmiwebstudio.com/blog/never-use-phpget-again-say-what/</link>
		<comments>http://www.cmiwebstudio.com/blog/never-use-phpget-again-say-what/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 05:27:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.cmiwebstudio.com/blog/?p=61</guid>
		<description><![CDATA[You don’t need to use $_GET or$_POST anymore. In fact, you probably shouldn’t use $_GET and$_POST anymore. Since PHP 5.2, there is a new and better way to safely retrieve user-submitted data. How many times have we heard about security issues in PHP applications stemming from unescaped GET and POST parameters? Proper escaping of input is a perennial [...]]]></description>
			<content:encoded><![CDATA[<p>You don’t need to use <code>$_GET</code> or<code>$_POST</code> anymore. In fact, you probably <em>shouldn’t</em> use <code>$_GET</code> and<code>$_POST</code> anymore. Since PHP 5.2, there is a new and better way to safely retrieve user-submitted data.</p>
<p>How many times have we heard about security issues in PHP applications stemming from unescaped GET and POST parameters? Proper escaping of input is a perennial problem with web development in general, and for whatever reason PHP seems to have had more than its fair share of bad publicity on this front.</p>
<p>On the database side, many worries over SQL injection have been squelched. The clever developers of PDO, for example, have constructed a library that analyzes data and escapes it appropriately. But the problem of validating and sanitizing input is still a substantial issue. To my surprise, many seasoned PHP developers still spend precious development cycles building custom code to filter input.</p>
<p>Why is this surprising? Because PHP (from 5.2 onward) has a built-in filtering system that makes the tasks of validating and sanitizing data trivially easy. Rather than accessing the<code>$_GET</code> and <code>$_POST</code> superglobals directly, you can make use of PHP functions like<code>filter_input()</code> and <code>filter_input_array()</code>. Let’s take a quick look at an example:</p>
<pre>&lt;?php
$my_string = filter_input(INPUT_GET, ‘my_string’, FILTER_SANITIZE_STRING);
?&gt;</pre>
<p>The code above is roughly the equivalent of retrieving <code>$_GET[‘my_string’]</code> and then running it through some sort of filter that strips HTML and other undesirable characters. This represents data sanitization, one of the two things that the filtering system can do. These are the two tasks of the filtering system:</p>
<ul>
<li><strong>Validation:</strong> Making sure the supplied data complies with specific expectations. In this mode, the filtering system will indicate (as a boolean) whether or not the data matches some criterion.</li>
<li><strong>Sanitizing:</strong> Removing unwanted data from the input and performing any necessary type coercion. In this mode the filtering system returns the sanitized data.</li>
</ul>
<p>By default, the filter system provides a menagerie of filters ranging from validation and sanitization of basic types (booleans, integers, floats, etc.) to more advanced filters which allow regular expressions or even custom callbacks.</p>
<p>The utility of this library should be obvious. Gone are the days of rolling our own input checking tools. We can use a standard (and better performing) built-in system.</p>
<p>Filters won’t solve every security-related problem, but they are a tremendous step in the right direction when it comes to writing safe (and performant) code. It’s also simpler. Sure, the function call is longer, but it relieves developers of the need to write their own filtering systems. These are darn good reasons to never use <code>$_GET</code> (or <code>$_POST</code> and the others) again.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cmiwebstudio.com/blog/never-use-phpget-again-say-what/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 Things You Need to Know to Get Started on Twitter</title>
		<link>http://www.cmiwebstudio.com/blog/10-things-you-need-to-know-to-get-started-on-twitter/</link>
		<comments>http://www.cmiwebstudio.com/blog/10-things-you-need-to-know-to-get-started-on-twitter/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 04:34:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Marketing]]></category>
		<category><![CDATA[social media]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://www.cmiwebstudio.com/blog/?p=56</guid>
		<description><![CDATA[1. Using Twitter is Simple; Using it Well is a Challenge However complicated it may seem when you first log on to your new account, Twitter is a simple platform. You can write 140-character updates that will be seen by your followers and also watch a news stream of comments left by people you follow. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>1. Using Twitter is Simple; Using it Well is a Challenge</strong></p>
<p>However complicated it may seem when you first log on to your new account, Twitter is a simple platform.</p>
<p>You can write 140-character updates that will be seen by your followers and also watch a news stream of comments left by people you follow. To direct a comment at a specific follower, simply prefix their name with &#8220;@&#8221; &#8212; for example, &#8220;@kevgibbo + your message.&#8221;</p>
<p>Send a direct message (one that can&#8217;t be seen by anyone other than the recipient) by prefixing a name with a &#8220;d&#8221; &#8212; for example: &#8220;d kevgibbo + your message.&#8221;</p>
<p>More Social Media<br />
A Day in the Life of a Trending Topic<br />
What History Tells us About Facebook&#8217;s Potential as a Search Engine, Part 2<br />
How to be a Social Media Medic<br />
Twitter has also created new grammar &#8212; the hashtag. This allows people to conduct simple searches and see what people are saying about a topic &#8212; for example, #leadersdebate during the U.K. election.</p>
<p>Some people use the hashtag ironically or to convey humor, without expecting their chosen term to catch on. For example, someone might tweet about how marvellous their recent SEO campaign has been and then add #modesty.</p>
<p>That&#8217;s the bare bones of using Twitter. Using it effectively is much, much harder, which you&#8217;ll see in the next nine tips.</p>
<p><strong>2. Twitter Needs a Strategy</strong></p>
<p>Before you begin investing time and energy in Twitter, sit down and work out what you want to use it for. Using Twitter only because everyone else is using it won&#8217;t win you success.</p>
<p>Do you want to build small scale relationships or market a major brand? Do you intend to actually drive business using your Twitter account or simply drive people to your website?</p>
<p>Unless you know your goals, you won&#8217;t be able to measure your success.</p>
<p><strong>3. Your Account Must Look Professional</strong></p>
<p>Before you start using your Twitter account, make sure it looks professional. Update your bio, add the company logo as an avatar, and customize your page.</p>
<p>Some people&#8217;s first interaction with your brand will be via Twitter, so make sure it&#8217;s as professional as your website and office space.</p>
<p><strong>4. You Should Search for Mentions&#8230;</strong></p>
<p>Monitor Twitter for mentions of your brand, products, well-known staff &#8212; any terms that people might conceivably use in reference to you.</p>
<p>Twitter will present you with any specific mentions of your account name but you can also run searches. Using software like TweetDeck allows you to set up permanent searches and be presented with relevant tweets as they happen.</p>
<p><strong>5. &#8230;and Reply</strong></p>
<p>You&#8217;re using Twitter in order to have conversations with people. If there&#8217;s a positive mention of your brand, thank the person who made it. If it&#8217;s negative, then get your customer service team to address the problem &#8212; often a positive resolution can turn a critic into a fan. If someone asks a question then answer it.</p>
<p>Be as polite on Twitter as you would be at a conference or some other industry event where you deal with people in person.</p>
<p><strong>6. Spamming Harms Brands</strong></p>
<p>Several brands (and even politicians) have fallen down on Twitter because they don&#8217;t really understand how people use it. The platform is social and has to be used socially. If you&#8217;re intrusive, you&#8217;ll alienate the people you want to win over.</p>
<p>Tweet links to blog posts, comments, thoughts, questions, even special offers now and again. But don&#8217;t simply pour out sales pitches. People won&#8217;t follow you and anyone encountering your tweets won&#8217;t leave with a good impression of your brand.</p>
<p>By the way, following thousands of people to try and build your own followers is spam, even if you aren&#8217;t sending them sales pitches.</p>
<p><strong>7. Automated Actions are Useless</strong></p>
<p>Twitter needs to be hand fed because it&#8217;s all about quality, not quantity. You can&#8217;t automate personable, social tweeting.</p>
<p>Also, the roll-out of top tweets means that quality is already beginning to be more rewarded, while those aiming for quantity of tweets will quickly gain a bad reputation as spammers!</p>
<p>By auto-following new followers, retweeting mentions, and automatically tweeting blog posts, you may have a working Twitter account, but it won&#8217;t be working well.</p>
<p><strong>8. Your Followers Want Value</strong></p>
<p>Why should people follow you on Twitter? What will they get out of it? Whether it&#8217;s humorous tweets, inspired analysis and tips, links to fascinating blog posts, industry breaking news, or discount vouchers, you must add value to their Twitter experience.</p>
<p>Otherwise you&#8217;re spamming and you&#8217;ll struggle to gain any followers.</p>
<p><strong>9. Make Your Tweets Retweetable</strong></p>
<p>You may only have a few followers &#8212; certainly at first. So you want your followers to retweet your posts to their followers, spreading the word about your brand. If your tweets are valuable enough, then that shouldn&#8217;t be a problem.</p>
<p>Also, make it easy for people to retweet. Keep your comment as short as possible because, when people retweet it, they will have to add &#8220;RT username&#8221; at the start. If you&#8217;ve used all 140 characters, then people will have to edit your words or chop off the link &#8212; or, even worse, use the new retweet button!</p>
<p><strong>10. Twitter Magnifies Mistakes</strong></p>
<p>More SEM Basics<br />
How to Measure Success in an SEO Campaign<br />
Managing Your Inventory Isn&#8217;t Just for Overnight Stock Boys<br />
Product Feeds Offer Untapped SEO, PPC Opportunities<br />
Get it wrong on Twitter and you risk a storm of mockery, especially if your brand is well known. Or, if a disgruntled employee tweets something abusive from your corporate account, it could be retweeted hundreds of thousands of times before the company even knows it&#8217;s happened.</p>
<p>Even a small brand that tweets too intrusively will find that recipients complain to their followers.</p>
<p>When you work out your strategy, work out some ground rules and make sure that everyone using your account understands them.</p>
<p>Doing social media badly is far worse than failing to do it. So behave well on the platform and treat people as you would like to be treated.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cmiwebstudio.com/blog/10-things-you-need-to-know-to-get-started-on-twitter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How Do You Decide Between C#, Java, PHP, and Python</title>
		<link>http://www.cmiwebstudio.com/blog/how-do-you-decide-between-c-java-php-and-python/</link>
		<comments>http://www.cmiwebstudio.com/blog/how-do-you-decide-between-c-java-php-and-python/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 03:29:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.cmiwebstudio.com/blog/?p=43</guid>
		<description><![CDATA[In particular, a debate between the C#/.NET/IIS stack and the Java/J2EE/Apache/Solaris stack and the PHP/Apache/Linux stack could go on and on for years and years and you’d never find the right answer. That’s because there are so many pros and cons of all these platforms that advocates of each side can debate and debate and [...]]]></description>
			<content:encoded><![CDATA[<p>In particular, a debate between the C#/.NET/IIS stack and the Java/J2EE/Apache/Solaris stack and the PHP/Apache/Linux stack could go on and on for years and years and you’d never find the right answer. That’s because there are so many pros and cons of all these platforms that advocates of each side can debate and debate and never get any closer to the truth, but it sure as heck is a fun debate.</p>
<p>There’s so much evidence that when it comes right down to it, millions of people are building huge business-critical things in C#, Java, PHP, or Python, and while they may have problems, they’re not mission threatening problems.</p>
<p>So how do you decide between C#, Java, PHP, and Python? The only real difference is which one YOU know better. If you have a serious PHP guru on your team who has built several large systems successfully with PHP, you’re going to be a heck of a lot more successful with PHP, not because PHP is a better language than C#, Java, or Python, but because he knows it better</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cmiwebstudio.com/blog/how-do-you-decide-between-c-java-php-and-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Browser Global Usage 2010</title>
		<link>http://www.cmiwebstudio.com/blog/web-browser-global-usage-2010/</link>
		<comments>http://www.cmiwebstudio.com/blog/web-browser-global-usage-2010/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 21:17:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General Web]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.cmiwebstudio.com/blog/?p=40</guid>
		<description><![CDATA[Global usage share of web browsers Q2 2010 Internet Explorer &#8211; 60.14% Mozilla Firefox &#8211; 24.98% Google Chrome &#8211; 7.14% Safari &#8211; 5.10% Opera &#8211; 2.66% And what that means to you and me, is all the &#8220;cool&#8221; stuff we want to do we can&#8217;t do until IE8 and lower disappear forever.  Anyone for mandatory [...]]]></description>
			<content:encoded><![CDATA[<p>Global usage share of web browsers Q2 2010</p>
<p>Internet Explorer &#8211; 60.14%<br />
Mozilla Firefox &#8211; 24.98%<br />
Google Chrome &#8211; 7.14%<br />
Safari &#8211; 5.10%<br />
Opera &#8211; 2.66%</p>
<p>And what that means to you and me, is all the &#8220;cool&#8221; stuff we want to do we can&#8217;t do until IE8 and lower disappear forever.  Anyone for mandatory IE9 upgrades?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cmiwebstudio.com/blog/web-browser-global-usage-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
