<?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>Tim Steeves - Software, Web, Business, Life &#187; Web Application Development</title>
	<atom:link href="http://timsteeves.com/category/software-development/web-application-development/feed" rel="self" type="application/rss+xml" />
	<link>http://timsteeves.com</link>
	<description>Software, Web, Business, Life</description>
	<lastBuildDate>Mon, 15 Feb 2010 17:57:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>New iTeam Site Launched</title>
		<link>http://timsteeves.com/2009/06/27/new-iteam-site-launched/%</link>
		<comments>http://timsteeves.com/2009/06/27/new-iteam-site-launched/%#comments</comments>
		<pubDate>Sat, 27 Jun 2009 22:32:06 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Web Application Development]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[business software]]></category>
		<category><![CDATA[crm]]></category>
		<category><![CDATA[website design]]></category>

		<guid isPermaLink="false">http://timsteeves.com/?p=139</guid>
		<description><![CDATA[For those of you who don&#8217;t know, iTeam consists of a highly qualified design and development team made up of graphic designers, programmers, and systems and business analysts. This team combines the skill and creativity required to promote your business online with website design and Search Engine Optimisation, increase online sales through website analytics, and [...]]]></description>
			<content:encoded><![CDATA[<p>For those of you who don&#8217;t know, iTeam consists of a highly qualified <strong>design and development team</strong> made up of graphic designers, programmers, and systems and business analysts. This team combines the skill and creativity required to promote your business online with website design and Search Engine Optimisation, increase online sales through website analytics, and improve productivity and efficiency through custom database software, and office network maintenance.</p>
<p>Check out the new site!</p>
<p><strong><a title="iTeam" href="http://www.iteamtech.ca" target="_blank">www.iTeamTech.ca</a></strong></p>
<p>I appreciate any feedback you have.  Feel free to leave a comment and let me know what you think!</p>
]]></content:encoded>
			<wfw:commentRss>http://timsteeves.com/2009/06/27/new-iteam-site-launched/%/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developing Web Applications for the iPhone with Eclipse</title>
		<link>http://timsteeves.com/2009/06/02/developing-web-applications-for-the-iphone-with-eclipse/%</link>
		<comments>http://timsteeves.com/2009/06/02/developing-web-applications-for-the-iphone-with-eclipse/%#comments</comments>
		<pubDate>Tue, 02 Jun 2009 20:08:28 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Web Application Development]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[applications]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://timsteeves.com/?p=115</guid>
		<description><![CDATA[Aptana has a plugin for Eclipse that makes developing websites and web applications for the iPhone really simple.  Here&#8217;s the installation notes from Aptana:
Installing this Plugin via Aptana or Eclipse

 From the Help menu, select Software Updates &#62; Find and Install&#8230; to open an Install/Update pop-up window.
 On the Install/Update pop-up window, choose the Search [...]]]></description>
			<content:encoded><![CDATA[<p>Aptana has a plugin for Eclipse that makes developing websites and web applications for the iPhone really simple.  Here&#8217;s the installation notes from Aptana:</p>
<h3>Installing this Plugin via Aptana or Eclipse</h3>
<ol>
<li> From the <strong>Help</strong> menu, select <strong>Software Updates &gt; Find and Install&#8230;</strong> to open an <strong>Install/Update</strong> pop-up window.</li>
<li> On the <strong>Install/Update</strong> pop-up window, choose the <strong>Search for new features to install</strong> option, and click the <strong>Next</strong> button.</li>
<li> Set up a new remote site to scan for updates.
<ol>
<li> Click the <strong>New Remote Site&#8230;</strong> button to open a <strong>New Update Site</strong> pop-up window.</li>
<li> On the <strong>New Update Site</strong> pop-up window, type the name of the new plug-in in the site <strong>Name</strong> text box.</li>
<li> In the <strong>URL</strong> text box, type the URL <a id="sitename" href="http://update2.aptana.org/studio/24131b/site.xml">http://update2.aptana.org/studio/24131b/</a> for the update site.</li>
<li> Click <strong>OK</strong>.</li>
<li> Click the <strong>Finish</strong> button to open an <strong>Updates</strong> window.</li>
</ol>
</li>
<li> On the <strong>Updates</strong> window, check the box next to the name of the plug-in, and click the <strong>Next</strong> button.</li>
<li> Choose the option to accept the terms of the license agreement, and click the <strong>Next</strong> button.</li>
<li> Click the <strong>Finish</strong> button.</li>
<li> Click the <strong>Install All</strong> button.</li>
</ol>
<p>Now when you create a new iPhone project, it adds in some nice CSS and other features that makes developing on the iPhone much simpler.</p>
]]></content:encoded>
			<wfw:commentRss>http://timsteeves.com/2009/06/02/developing-web-applications-for-the-iphone-with-eclipse/%/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Basic PHP Output Optimization</title>
		<link>http://timsteeves.com/2008/08/10/basic-php-output-optimization/%</link>
		<comments>http://timsteeves.com/2008/08/10/basic-php-output-optimization/%#comments</comments>
		<pubDate>Sun, 10 Aug 2008 07:33:52 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Application Development]]></category>

		<guid isPermaLink="false">http://timsteeves.com/?p=43</guid>
		<description><![CDATA[
Echo vs. Print
The most common way to output text with PHP is using echo or print. In this section we will see the similarities and the differences between them.
Similarities

They are both language constructs (not functions) so by all means drop the parentheses:
&#60;?php
    echo 'foo';

    print 'bar';
?&#62;

They can be used [...]]]></description>
			<content:encoded><![CDATA[<div class="box">
<h2 id="echovsprint">Echo vs. Print</h2>
<p>The most common way to output text with PHP is using <code>echo</code> or <code>print</code>. In this section we will see the similarities and the differences between them.</p>
<h3>Similarities</h3>
<ul class="text">
<li>They are both language constructs (not functions) so by all means drop the parentheses:
<pre><code><span class="php">&lt;?php</span>
    echo <var>'foo'</var>;<samp></samp>

    print <var>'bar'</var>;<samp></samp>
<span class="php">?&gt;</span></code></pre>
</li>
<li>They can be used to output multiple lines:
<pre><code><span class="php">&lt;?php</span>
    echo <var>'This is the first line.
    This is the second line.'</var>;<samp></samp>

    print <var>'As you can see,
    it works with print, too.'</var>;<samp></samp>
<span class="php">?&gt;</span></code></pre>
</li>
</ul>
<h3>Differences</h3>
<ul class="text">
<li><code>print</code> returns 1<code> </code>so it can be used as a function:
<pre><code><span class="php">&lt;?php</span>
    (1 == 1) ? print <var>'true'</var> : print <var>'false'</var>
    //Outputs<samp> 'true'</samp>

    (1 == 1) ? echo <var>'true'</var> : echo <var>'false'</var>
    <samp>//Doesn't work</samp>

    echo (1 == 1) ? <var>'true'</var> : <var>'false'</var>
    <samp>//</samp></code><code>Outputs<samp> 'true'</samp></code><code><samp></samp>
<span class="php">?&gt;</span></code></pre>
</li>
<li>With <code>echo</code> you can &#8220;concatenate&#8221; with a comma.  I put concatenate in quotes because it looks and feels like concatenation is happening, but it&#8217;s not actually concatenation.  I&#8217;ll talk about that more later.
<pre><code><span class="php">&lt;?php</span>
    echo <var>'With echo you can '</var>, <var>'use the comma '</var>, <var>'to output multiple parameters.'</var>;
    <samp>//Works</samp>

    print <var>'With print '</var>, <var>'you will get '</var>, <var>'an error.'</var>;
    <samp>//Doesn't work</samp>
<span class="php">?&gt;</span></code></pre>
</li>
</ul>
<p>Realistically there is no real reason to prefer <code>print</code> over <code>echo</code> unless you want to use it as a function.  Give me a solid case for this usage and I&#8217;ll bend, but I&#8217;ve never needed to use it.  <code>echo</code> can do all the things that <code>print</code> does better: it&#8217;s slightly faster than print&#8230;and it&#8217;s one less character to type!</p>
<h2 id="dotsvscommas">Dots vs. Commas</h2>
<p>As I mentioned earlier, you can use both dots and commas to output strings and variables using <code>echo</code> but with <code>print</code>, you can only use dots. So, what&#8217;s the difference?</p>
<p>When using dots, all the parts are concatenated to form a single string that will then be printed, while with commas, all the parts are printed individually, and although the end result appears to be concatenation, each item is actually output one-by-one.</p>
<p>This actually makes the use of commas slightly faster than using dots because the string concatenation is skipped but the end result is exactly the same &#8211; no spaces will be added between the arguments (like in Python) &#8211; so commas are the preferred method for outputting multiple string segments and variables with echo.</p>
<pre><code><span class="php">&lt;?php</span>
    $var = 'foobar';
    echo <var>'The value of $var is '</var>, $var;
    <samp>//Output: The value of $var is foobar</samp><samp></samp>
<span class="php">?&gt;</span></code></pre>
<h2 id="singlevsdouble">Single Quotes vs. Double Quotes</h2>
<p>In PHP there are two main ways to specify a string: single quotes (&#8217;<var>foo</var>&#8216;) and double quotes (&#8221;<var>bar</var>&#8220;).  		There&#8217;s also a couple more ways — heredoc and nowdoc — but I don&#8217;t want to get into that can of worms here.</p>
<h3>Single quotes</h3>
<p>When you need to output a plain string, the single quotes are probably the best idea.</p>
<p>Variables and escaped characters (e.g. <kbd>\n</kbd>, <kbd>\t</kbd>, <kbd>\"</kbd> etc.) will not be expanded, except for <kbd>\'</kbd> and <kbd>\\</kbd> (you can also write just a single <kbd>\</kbd> to output the backslash). This will make the parsing of a single quoted string slightly faster than a double quoted one, and you don&#8217;t have to escape double quotes (e.g. in HTML attributes) as we can see in the following examples:</p>
<pre><code><span class="php">&lt;?php</span>
    echo <var>'This is a plain string'</var>;
    <samp>//Output: This is a plain string</samp>

    $var = 123;
    echo <var>'This $var and this \n newline character will not be expanded.'</var>;
    <samp>//Output: This $var and this \n newline character will not be expanded.</samp>

    echo <var>'The \' single quote and the \\ backslash will be expanded.
    The single \ backslash works too.'</var>;
    <samp>//Output: The ' single quote and the \ backslash will be expanded.
    //The single \ backslash works too.</samp>

    echo <var>'&lt;img src="foo.jpg" alt="test" height="100" width="100"&gt;'</var>;
    <samp>//Output: &lt;img src="foo.jpg" alt="test" height="100" width="100"&gt;</samp>
<span class="php">?&gt;</span></code></pre>
<h3>Double quotes</h3>
<p>If you use a double quoted string, variables and escaped characters will be expanded.</p>
<pre><code><span class="php">&lt;?php</span>
    $var = 123;
    echo <var>"This $var will be expanded. You can also use \$var if you want to avoid it."</var>;
    <samp>//Output: This 123 will be expanded. You can also use $var if you want to avoid it.</samp>

    echo <var>"This characters will be expanded too:\nfoo\n\tbar\nbaz"</var>;
    <samp>//Output: This characters will be expanded too:
    //foo
    //    bar
    //baz</samp>

    echo <var>"&lt;img src=\"foo.jpg\" alt=\"test\" height=\"100\" width=\"100\"&gt;"</var>;
    <samp>//Output: &lt;img src="foo.jpg" alt="test" height="100" width="100"&gt;</samp>

    echo <var>"You can also print characters in octal and hexadecimal notation like \141 and \x62."</var>;
    <samp>//</samp></code><code>Output: </code><code><samp>You can also print characters in octal and hexadecimal notation like a and b.</samp>
<span class="php">?&gt;</span></code></pre>
<p>Bottom line is that it&#8217;s better to use single quotes and avoid to include variables inside the strings.  The only real time you may want to use double-quotes is when you have lot of variables that have to be included in a string.  In this case, the use of double quotes may improve the readability of the code.</p>
<h2 id="conclusions">Conclusion</h2>
<ul>
<li>Use <code>echo</code> instead of <code>print</code></li>
<li>Don&#8217;t use parentheses with echo (or any language constructs for that matter)</li>
<li>Use single quotes if you don&#8217;t have to use escaped characters or need to expand many variables<kbd></kbd></li>
<li>Always use a comma instead of a dot when joining strings and variables in an <code>echo</code> statement</li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://timsteeves.com/2008/08/10/basic-php-output-optimization/%/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
