<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: PHP !== Java</title>
	<atom:link href="http://lukewelling.com/2008/12/20/php-java/feed/" rel="self" type="application/rss+xml" />
	<link>http://lukewelling.com/2008/12/20/php-java/</link>
	<description>Just another nerd’s weblog</description>
	<lastBuildDate>Mon, 15 Feb 2010 06:11:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Helga</title>
		<link>http://lukewelling.com/2008/12/20/php-java/comment-page-1/#comment-3065</link>
		<dc:creator>Helga</dc:creator>
		<pubDate>Mon, 28 Dec 2009 03:32:42 +0000</pubDate>
		<guid isPermaLink="false">http://lukewelling.com/2008/12/22/php-java/#comment-3065</guid>
		<description>I don&#039;t understand why is everyone discussing Singleton implementation.   I totally agree with what I believe is the true intent of this post, which is the attempt to transform a language in to something that is not &quot;in it&#039;s nature&quot;.  I will have to make my opinion humble for I have no more than 1,5 year experience in codding... Though the author gives more physical examples... I&#039;d give another more... ethereal? One usually speaks according to context. farmers have their dialect, politicians have their dialect.. And though there may be farmers who can speak like politicians, and politicians who can speak like farmers. Most politicians and farmers will not be able  to switch parts.. what is happening is that universities don&#039;t teach php, in fact they don&#039;t teach any script language other than javascript... and quite in the &quot;demonstration by intimidation... obvious&quot; style. but they do teach java, and c++ and c#. All oop languages.. strongly typed. So when these coders &quot;hit the streets&quot; they don&#039;t speak script... they speak oop. And because they don&#039;t care about nature, nor do they understand beauty they keep speaking oop.  The problems arise from the complexity one adds without necessity. But that complexity could only be perceived by an experienced php programmer or a concerned oop developer. For a farmer will always feel greater sympathy for a politician that speaks like a farmer..  The question here really is. Can we make all those farmers speak politician? will they be willing to? won&#039;t they create more problems while working with an unfamiliar environment? Hopefully the frameworks will continue to be loyal to the language nature.. and one can rely on those.  * my two cents...*</description>
		<content:encoded><![CDATA[<p>I don&#8217;t understand why is everyone discussing Singleton implementation.   I totally agree with what I believe is the true intent of this post, which is the attempt to transform a language in to something that is not &#8220;in it&#8217;s nature&#8221;.  I will have to make my opinion humble for I have no more than 1,5 year experience in codding&#8230; Though the author gives more physical examples&#8230; I&#8217;d give another more&#8230; ethereal? One usually speaks according to context. farmers have their dialect, politicians have their dialect.. And though there may be farmers who can speak like politicians, and politicians who can speak like farmers. Most politicians and farmers will not be able  to switch parts.. what is happening is that universities don&#8217;t teach php, in fact they don&#8217;t teach any script language other than javascript&#8230; and quite in the &#8220;demonstration by intimidation&#8230; obvious&#8221; style. but they do teach java, and c++ and c#. All oop languages.. strongly typed. So when these coders &#8220;hit the streets&#8221; they don&#8217;t speak script&#8230; they speak oop. And because they don&#8217;t care about nature, nor do they understand beauty they keep speaking oop.  The problems arise from the complexity one adds without necessity. But that complexity could only be perceived by an experienced php programmer or a concerned oop developer. For a farmer will always feel greater sympathy for a politician that speaks like a farmer..  The question here really is. Can we make all those farmers speak politician? will they be willing to? won&#8217;t they create more problems while working with an unfamiliar environment? Hopefully the frameworks will continue to be loyal to the language nature.. and one can rely on those.  * my two cents&#8230;*</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robin</title>
		<link>http://lukewelling.com/2008/12/20/php-java/comment-page-1/#comment-3064</link>
		<dc:creator>Robin</dc:creator>
		<pubDate>Sat, 20 Jun 2009 21:02:05 +0000</pubDate>
		<guid isPermaLink="false">http://lukewelling.com/2008/12/22/php-java/#comment-3064</guid>
		<description>I think the main thing with using a singleton when a (what&#039;s the word?) not-singleton will do is probably just a case of &quot;I&#039;m doing this because it&#039;s the right thing&quot;

If the thing works, why try to fix it, eh?</description>
		<content:encoded><![CDATA[<p>I think the main thing with using a singleton when a (what&#8217;s the word?) not-singleton will do is probably just a case of &#8220;I&#8217;m doing this because it&#8217;s the right thing&#8221;</p>
<p>If the thing works, why try to fix it, eh?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roderick Kar</title>
		<link>http://lukewelling.com/2008/12/20/php-java/comment-page-1/#comment-3063</link>
		<dc:creator>Roderick Kar</dc:creator>
		<pubDate>Thu, 23 Apr 2009 09:37:43 +0000</pubDate>
		<guid isPermaLink="false">http://lukewelling.com/2008/12/22/php-java/#comment-3063</guid>
		<description>This may not be the most appropriate place to post my question. I bought a kindle edition of your 4/e php and mysql web development. I have registered it on informit but I couldn&#039;t find where can I download the contents that come with the CD that accompanies the physical book.</description>
		<content:encoded><![CDATA[<p>This may not be the most appropriate place to post my question. I bought a kindle edition of your 4/e php and mysql web development. I have registered it on informit but I couldn&#8217;t find where can I download the contents that come with the CD that accompanies the physical book.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: void star</title>
		<link>http://lukewelling.com/2008/12/20/php-java/comment-page-1/#comment-3062</link>
		<dc:creator>void star</dc:creator>
		<pubDate>Sat, 10 Jan 2009 18:32:36 +0000</pubDate>
		<guid isPermaLink="false">http://lukewelling.com/2008/12/22/php-java/#comment-3062</guid>
		<description>An ironic linguistic example given that one explanation for the phrase &quot;raining cats and dogs&quot; is that it is a mis-translation of the French word &quot;catadoupe&quot;, meaning &quot;waterfall&quot;.</description>
		<content:encoded><![CDATA[<p>An ironic linguistic example given that one explanation for the phrase &#8220;raining cats and dogs&#8221; is that it is a mis-translation of the French word &#8220;catadoupe&#8221;, meaning &#8220;waterfall&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Richard C</title>
		<link>http://lukewelling.com/2008/12/20/php-java/comment-page-1/#comment-3061</link>
		<dc:creator>Richard C</dc:creator>
		<pubDate>Sat, 03 Jan 2009 13:19:35 +0000</pubDate>
		<guid isPermaLink="false">http://lukewelling.com/2008/12/22/php-java/#comment-3061</guid>
		<description>Actually Singletons in java are now (since 1.5) written as enums. As best practice.

enum Singleton{
instance;

 public static Integer getCount(){
  return 30;
 }
}</description>
		<content:encoded><![CDATA[<p>Actually Singletons in java are now (since 1.5) written as enums. As best practice.</p>
<p>enum Singleton{<br />
instance;</p>
<p> public static Integer getCount(){<br />
  return 30;<br />
 }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mart</title>
		<link>http://lukewelling.com/2008/12/20/php-java/comment-page-1/#comment-3060</link>
		<dc:creator>Mart</dc:creator>
		<pubDate>Sun, 28 Dec 2008 15:18:44 +0000</pubDate>
		<guid isPermaLink="false">http://lukewelling.com/2008/12/22/php-java/#comment-3060</guid>
		<description>People, you should read this blog entry http://www.stubbles.org/archives/56-How-to-get-a-Singleton-right.html</description>
		<content:encoded><![CDATA[<p>People, you should read this blog entry <a href="http://www.stubbles.org/archives/56-How-to-get-a-Singleton-right.html" rel="nofollow">http://www.stubbles.org/archives/56-How-to-get-a-Singleton-right.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ajclose</title>
		<link>http://lukewelling.com/2008/12/20/php-java/comment-page-1/#comment-3059</link>
		<dc:creator>ajclose</dc:creator>
		<pubDate>Tue, 23 Dec 2008 22:57:38 +0000</pubDate>
		<guid isPermaLink="false">http://lukewelling.com/2008/12/22/php-java/#comment-3059</guid>
		<description>For a second there Luke I thought you were talking about Perl... ;)
And thanks for teaching me a new French expression!</description>
		<content:encoded><![CDATA[<p>For a second there Luke I thought you were talking about Perl&#8230; <img src='http://lukewelling.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
And thanks for teaching me a new French expression!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mjomble</title>
		<link>http://lukewelling.com/2008/12/20/php-java/comment-page-1/#comment-3058</link>
		<dc:creator>Mjomble</dc:creator>
		<pubDate>Tue, 23 Dec 2008 13:39:29 +0000</pubDate>
		<guid isPermaLink="false">http://lukewelling.com/2008/12/22/php-java/#comment-3058</guid>
		<description>(Sorry about the indentation, the comment system ate it)</description>
		<content:encoded><![CDATA[<p>(Sorry about the indentation, the comment system ate it)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mjomble</title>
		<link>http://lukewelling.com/2008/12/20/php-java/comment-page-1/#comment-3057</link>
		<dc:creator>Mjomble</dc:creator>
		<pubDate>Tue, 23 Dec 2008 13:38:30 +0000</pubDate>
		<guid isPermaLink="false">http://lukewelling.com/2008/12/22/php-java/#comment-3057</guid>
		<description>Hmm. Why use separate classes for MyObject and Singleton (and leaving MyObject&#039;s constructor public so it could still be misused) if you could just add singleton behavior to the MyObject class itself?

class MyObject
{
  private static $singleton;

  public static function getInstance()
  {
    if (!isset(self::$singleton))
    {
      self::$singleton = new self();
    }

    return self::$singleton;
  }

  private function __clone()
  {
  }

  private function __construct()
  {
    // MyObject&#039;s regular constructor made private
  }

}

And then if you need to use that in a large number of different places, you end up with lots of calls to MyObject::getInstance(); instead of the &quot;simpler&quot; 5-line version you suggest :)</description>
		<content:encoded><![CDATA[<p>Hmm. Why use separate classes for MyObject and Singleton (and leaving MyObject&#8217;s constructor public so it could still be misused) if you could just add singleton behavior to the MyObject class itself?</p>
<p>class MyObject<br />
{<br />
  private static $singleton;</p>
<p>  public static function getInstance()<br />
  {<br />
    if (!isset(self::$singleton))<br />
    {<br />
      self::$singleton = new self();<br />
    }</p>
<p>    return self::$singleton;<br />
  }</p>
<p>  private function __clone()<br />
  {<br />
  }</p>
<p>  private function __construct()<br />
  {<br />
    // MyObject&#8217;s regular constructor made private<br />
  }</p>
<p>}</p>
<p>And then if you need to use that in a large number of different places, you end up with lots of calls to MyObject::getInstance(); instead of the &#8220;simpler&#8221; 5-line version you suggest <img src='http://lukewelling.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pekka</title>
		<link>http://lukewelling.com/2008/12/20/php-java/comment-page-1/#comment-3056</link>
		<dc:creator>Pekka</dc:creator>
		<pubDate>Tue, 23 Dec 2008 12:35:45 +0000</pubDate>
		<guid isPermaLink="false">http://lukewelling.com/2008/12/22/php-java/#comment-3056</guid>
		<description>@PHP Vet: Read the sentence again. Luke is saying exactly the opposite of what you think he is saying.</description>
		<content:encoded><![CDATA[<p>@PHP Vet: Read the sentence again. Luke is saying exactly the opposite of what you think he is saying.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
