<?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"
	>
<channel>
	<title>Comments on: PHP Namespaces</title>
	<atom:link href="http://agilewebmasters.com/nick/php-namespaces/feed/" rel="self" type="application/rss+xml" />
	<link>http://agilewebmasters.com/nick/php-namespaces/</link>
	<description>Take the lead out...</description>
	<pubDate>Fri, 12 Mar 2010 17:34:40 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: Nick Ashley</title>
		<link>http://agilewebmasters.com/nick/php-namespaces/#comment-2477</link>
		<dc:creator>Nick Ashley</dc:creator>
		<pubDate>Mon, 27 Oct 2008 23:12:17 +0000</pubDate>
		<guid isPermaLink="false">http://agilewebmasters.com/?p=231#comment-2477</guid>
		<description>I guess I am just surprised that a (arguably) slightly uglier solution which works in all situations isn't favored over a (arguably) better looking solution that doesn't. Sure, many will say it is bad practice to name a static function inside a class the same as a different class in a namespace. However the whole point of namespacing is to allow code from multiple sources to play nice together. Of course a single programmer utilizing only his own code wouldn't run into any problems with '::', but from what I understand, someone utilizing classes from many sources could run into this problem. Remember that for better or worse, PHP is the language of choice for many copy and paste coders, and I think that is a relevant fact.</description>
		<content:encoded><![CDATA[<p>I guess I am just surprised that a (arguably) slightly uglier solution which works in all situations isn&#8217;t favored over a (arguably) better looking solution that doesn&#8217;t. Sure, many will say it is bad practice to name a static function inside a class the same as a different class in a namespace. However the whole point of namespacing is to allow code from multiple sources to play nice together. Of course a single programmer utilizing only his own code wouldn&#8217;t run into any problems with &#8216;::&#8217;, but from what I understand, someone utilizing classes from many sources could run into this problem. Remember that for better or worse, PHP is the language of choice for many copy and paste coders, and I think that is a relevant fact.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Gentel</title>
		<link>http://agilewebmasters.com/nick/php-namespaces/#comment-2474</link>
		<dc:creator>Robert Gentel</dc:creator>
		<pubDate>Mon, 27 Oct 2008 21:50:37 +0000</pubDate>
		<guid isPermaLink="false">http://agilewebmasters.com/?p=231#comment-2474</guid>
		<description>I find the backslash horribly ugly as well. Sure, that doesn't mean it won't work but a in a discussion about naming conventions it's often less about what works than what seems orderly and sensible because with few precautions anything works.</description>
		<content:encoded><![CDATA[<p>I find the backslash horribly ugly as well. Sure, that doesn&#8217;t mean it won&#8217;t work but a in a discussion about naming conventions it&#8217;s often less about what works than what seems orderly and sensible because with few precautions anything works.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick Ashley</title>
		<link>http://agilewebmasters.com/nick/php-namespaces/#comment-2425</link>
		<dc:creator>Nick Ashley</dc:creator>
		<pubDate>Sun, 26 Oct 2008 22:38:32 +0000</pubDate>
		<guid isPermaLink="false">http://agilewebmasters.com/?p=231#comment-2425</guid>
		<description>Boris - if they deprecate "::" for static functions, what would they replace it with? There would have to be some other syntax for static functions, unless your suggestion is to remove static functions from the language. 

Nimh - I kind of understand where you are coming from with keeping a familiar syntax across languages, but don't know how much weight I would put on that. If every programming language had the same syntax for everything, except PHP was the odd man out, then you would definitely have a point. However every language has there own way to do things like string concatenation, testing equality, or ending statements. Adding namespacing to the mix isn't that big of a deal IMHO. 

I feel that it would be even harder to learn the language when syntax means two different things. People would be confused saying "I thought that was how you accessed a static function, not a namespace!". With the backslash, you have a standard way to do everything. Also, I feel you SHOULD be using single quotes, thus eliminating the escaping issue. However, the escaping is a standard way to do things when working with double quotes as well. Why would this confuse them?</description>
		<content:encoded><![CDATA[<p>Boris - if they deprecate &#8220;::&#8221; for static functions, what would they replace it with? There would have to be some other syntax for static functions, unless your suggestion is to remove static functions from the language. </p>
<p>Nimh - I kind of understand where you are coming from with keeping a familiar syntax across languages, but don&#8217;t know how much weight I would put on that. If every programming language had the same syntax for everything, except PHP was the odd man out, then you would definitely have a point. However every language has there own way to do things like string concatenation, testing equality, or ending statements. Adding namespacing to the mix isn&#8217;t that big of a deal IMHO. </p>
<p>I feel that it would be even harder to learn the language when syntax means two different things. People would be confused saying &#8220;I thought that was how you accessed a static function, not a namespace!&#8221;. With the backslash, you have a standard way to do everything. Also, I feel you SHOULD be using single quotes, thus eliminating the escaping issue. However, the escaping is a standard way to do things when working with double quotes as well. Why would this confuse them?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Boris</title>
		<link>http://agilewebmasters.com/nick/php-namespaces/#comment-2416</link>
		<dc:creator>Boris</dc:creator>
		<pubDate>Sun, 26 Oct 2008 19:54:55 +0000</pubDate>
		<guid isPermaLink="false">http://agilewebmasters.com/?p=231#comment-2416</guid>
		<description>the real problem is that the PHP language masters didn't just do the right thing and deprecate the use of "::" for static functions. at some point you have to move the language forward, and keep it consistent and beautiful. but, the PHP people chose to instead put an ugly hack in to try to get the best of both worlds. this *is* PHP we're talking about here - is anyone really surprised?</description>
		<content:encoded><![CDATA[<p>the real problem is that the PHP language masters didn&#8217;t just do the right thing and deprecate the use of &#8220;::&#8221; for static functions. at some point you have to move the language forward, and keep it consistent and beautiful. but, the PHP people chose to instead put an ugly hack in to try to get the best of both worlds. this *is* PHP we&#8217;re talking about here - is anyone really surprised?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ninh</title>
		<link>http://agilewebmasters.com/nick/php-namespaces/#comment-2414</link>
		<dc:creator>Ninh</dc:creator>
		<pubDate>Sun, 26 Oct 2008 18:46:31 +0000</pubDate>
		<guid isPermaLink="false">http://agilewebmasters.com/?p=231#comment-2414</guid>
		<description>Maybe I’ve not made myself clear enough in my blog post. You see, aesthetics aside, I’d rather have them use a way to denote a namespace separator in a way that is commonly used in other programming languages. This makes it easier to read or learn PHP if you’re already familiar with other languages who use the same notation. With this train of thought, a dot would’ve been perfectly fine by me as well. Unfortunately, this is already being used in PHP for string concatenation in the parse rule: “String DOT String”.

This is the same reason why I have problems with using the backslash as a namespace seperator seeing as programmers will be more likely to associate it with escaping. This also makes it harder imho to learn a language.

Not only that, let’s not forget that if you ever were to instantiate your classes through strings via factory method (which is frowned upon by some to begin with), http://loveandtheft.org/2008/10/26/set-sail-for-fail-php-namespaces/ elaborates on some of the issues you’ll have to deal with as well. For instance, in case you write “foo\tBar”, which is valid PHP code, while trying to say namespace foo and member tBar, you’ll get erroneous behaviour that is easily overlooked. Even an IDE wouldn’t be able to save you in such a situation.

Aesthetics aside, there are plenty of other reasons why I’m complaining here. I hope people don’t forget to read that as well.</description>
		<content:encoded><![CDATA[<p>Maybe I’ve not made myself clear enough in my blog post. You see, aesthetics aside, I’d rather have them use a way to denote a namespace separator in a way that is commonly used in other programming languages. This makes it easier to read or learn PHP if you’re already familiar with other languages who use the same notation. With this train of thought, a dot would’ve been perfectly fine by me as well. Unfortunately, this is already being used in PHP for string concatenation in the parse rule: “String DOT String”.</p>
<p>This is the same reason why I have problems with using the backslash as a namespace seperator seeing as programmers will be more likely to associate it with escaping. This also makes it harder imho to learn a language.</p>
<p>Not only that, let’s not forget that if you ever were to instantiate your classes through strings via factory method (which is frowned upon by some to begin with), <a href="http://loveandtheft.org/2008/10/26/set-sail-for-fail-php-namespaces/" rel="nofollow">http://loveandtheft.org/2008/10/26/set-sail-for-fail-php-namespaces/</a> elaborates on some of the issues you’ll have to deal with as well. For instance, in case you write “foo\tBar”, which is valid PHP code, while trying to say namespace foo and member tBar, you’ll get erroneous behaviour that is easily overlooked. Even an IDE wouldn’t be able to save you in such a situation.</p>
<p>Aesthetics aside, there are plenty of other reasons why I’m complaining here. I hope people don’t forget to read that as well.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
