<?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>Designoplasty Web Design and Development Blog &#187; Camel Case</title>
	<atom:link href="http://designoplasty.com/tag/camel-case/feed/" rel="self" type="application/rss+xml" />
	<link>http://designoplasty.com</link>
	<description>HTML, Javascript, PHP, and Me</description>
	<lastBuildDate>Wed, 08 Sep 2010 09:25:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP, Classes, Camel Case, and Underlines</title>
		<link>http://designoplasty.com/2009/11/18/php-classes-camel-case-and-underlines/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=php-classes-camel-case-and-underlines</link>
		<comments>http://designoplasty.com/2009/11/18/php-classes-camel-case-and-underlines/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 23:40:30 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Camel Case]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming Languanges]]></category>

		<guid isPermaLink="false">http://designoplasty.com/?p=1051</guid>
		<description><![CDATA[When I first started PHP programming, I wrote code like the PHP inventors wrote code, using lowercase characters and underlines, like:

$my_favorite_variable = 5;

function add_numbers($first_number, $second_number)
{
    return $first_number + $second_number;
}

$answer = add_numbers($my_favorite_variable, 1);

But this became tiresome. The thing is, the underscore character is harder to type and using all lowercase really makes the [...]]]></description>
			<content:encoded><![CDATA[<p>When I first started PHP programming, I wrote code like the PHP inventors wrote code, using lowercase characters and underlines, like:</p>

<pre><code>$my_favorite_variable = 5;

function add_numbers($first_number, $second_number)
{
    return $first_number + $second_number;
}

$answer = add_numbers($my_favorite_variable, 1);</code></pre>

<p>But this became tiresome. The thing is, the underscore character is harder to type and using all lowercase really makes the code blur together at a glance. Also, it&#8217;s harder to tell the difference between variables and function names. After writing code at Microsoft for many years, I know that camel case is the way to go. Even Apple uses camel case. Modern C programming uses camel case. The PHP inventors made a mistake when using all those underscores.<p>

<p>Using camel case and adding in classes, the code becomes so much cleaner:</p>

<pre><code>$myFavoriteVariable = 5;

class Calculator
{
    public static function Add($firstNumber, $secondNumber)
    {
        return $firstNumber + $secondNumber;
    }
}

$answer = Calculator::Add($myFavoriteVariable, 1);</code></pre>

<p>Doesn&#8217;t that look better? We&#8217;re at this point in history where we&#8217;ve pretty much figured out that for all languages camel case it the easiest to read. Start variables with lowercase, classes and methods with uppercase and it looks so nice.</p>

<p>Having said that, every time I start to work on something I haven&#8217;t touched in a while there&#8217;s a flurry of code refactoring, but it feels so good to get that done. And it&#8217;s so much easier to read.</p>
]]></content:encoded>
			<wfw:commentRss>http://designoplasty.com/2009/11/18/php-classes-camel-case-and-underlines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
