<?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 interfaces and optional parameters</title>
	<atom:link href="http://cdmckay.org/blog/2010/04/24/php-interfaces-and-optional-parameters/feed/" rel="self" type="application/rss+xml" />
	<link>http://cdmckay.org/blog/2010/04/24/php-interfaces-and-optional-parameters/</link>
	<description>Programming and Game Development</description>
	<lastBuildDate>Mon, 02 Apr 2012 20:01:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: cdmckay</title>
		<link>http://cdmckay.org/blog/2010/04/24/php-interfaces-and-optional-parameters/comment-page-1/#comment-428</link>
		<dc:creator>cdmckay</dc:creator>
		<pubDate>Mon, 26 Apr 2010 04:16:53 +0000</pubDate>
		<guid isPermaLink="false">http://cdmckay.org/blog/?p=1480#comment-428</guid>
		<description>@Max Win:

If I understand you correctly, you are saying that you have an issue with the fact that one can include an optional parameter in their implementation of compareTo($object).

Encapsulation is not violated here.  This is because the interface is still fully implemented.  The interface only demands that the implementer respond to the call compareTo($object).  Thus, people should only expect that call to work.</description>
		<content:encoded><![CDATA[<p>@Max Win:</p>
<p>If I understand you correctly, you are saying that you have an issue with the fact that one can include an optional parameter in their implementation of compareTo($object).</p>
<p>Encapsulation is not violated here.  This is because the interface is still fully implemented.  The interface only demands that the implementer respond to the call compareTo($object).  Thus, people should only expect that call to work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Max Win</title>
		<link>http://cdmckay.org/blog/2010/04/24/php-interfaces-and-optional-parameters/comment-page-1/#comment-427</link>
		<dc:creator>Max Win</dc:creator>
		<pubDate>Sun, 25 Apr 2010 16:29:00 +0000</pubDate>
		<guid isPermaLink="false">http://cdmckay.org/blog/?p=1480#comment-427</guid>
		<description>What a surprise. I certainly appreciate the flexibility the optional parameters brings. But one big advantage of interface is that it allows you to change the code without affecting those that call the methods. Imagine I first implemented a function with an optional parameter and other parts of my program call the method with the optional parameter. Later i decided to change my code so that the code no longer deals with the optional parameter. Previous method calls with the optional parameter will still work but not in a way you would expect it.

eg.  compareTo(object, true) will be no different from compareTo(object,false) since the optional parameter will just be ignored. This can be confusing for a different programmer reading the code. He needs to read the implementation to figure out what is really going on. And this totally beats the purpose of encapsulation.</description>
		<content:encoded><![CDATA[<p>What a surprise. I certainly appreciate the flexibility the optional parameters brings. But one big advantage of interface is that it allows you to change the code without affecting those that call the methods. Imagine I first implemented a function with an optional parameter and other parts of my program call the method with the optional parameter. Later i decided to change my code so that the code no longer deals with the optional parameter. Previous method calls with the optional parameter will still work but not in a way you would expect it.</p>
<p>eg.  compareTo(object, true) will be no different from compareTo(object,false) since the optional parameter will just be ignored. This can be confusing for a different programmer reading the code. He needs to read the implementation to figure out what is really going on. And this totally beats the purpose of encapsulation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: uberVU - social comments</title>
		<link>http://cdmckay.org/blog/2010/04/24/php-interfaces-and-optional-parameters/comment-page-1/#comment-426</link>
		<dc:creator>uberVU - social comments</dc:creator>
		<pubDate>Sun, 25 Apr 2010 04:54:50 +0000</pubDate>
		<guid isPermaLink="false">http://cdmckay.org/blog/?p=1480#comment-426</guid>
		<description>&lt;strong&gt;Social comments and analytics for this post...&lt;/strong&gt;

This post was mentioned on Twitter by Technojobz: PHP interfaces and optional parameters http://dlvr.it/cTMr...</description>
		<content:encoded><![CDATA[<p><strong>Social comments and analytics for this post&#8230;</strong></p>
<p>This post was mentioned on Twitter by Technojobz: PHP interfaces and optional parameters <a href="http://dlvr.it/cTMr" >http://dlvr.it/cTMr</a>&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tweets that mention PHP interfaces and optional parameters » Cameron McKay -- Topsy.com</title>
		<link>http://cdmckay.org/blog/2010/04/24/php-interfaces-and-optional-parameters/comment-page-1/#comment-425</link>
		<dc:creator>Tweets that mention PHP interfaces and optional parameters » Cameron McKay -- Topsy.com</dc:creator>
		<pubDate>Sun, 25 Apr 2010 04:51:46 +0000</pubDate>
		<guid isPermaLink="false">http://cdmckay.org/blog/?p=1480#comment-425</guid>
		<description>[...] This post was mentioned on Twitter by Peter Wooley, Thomas Buck, Hacker News, hkrnws, Technojobz and others. Technojobz said: PHP interfaces and optional parameters http://dlvr.it/cTMr [...]</description>
		<content:encoded><![CDATA[<p>[...] This post was mentioned on Twitter by Peter Wooley, Thomas Buck, Hacker News, hkrnws, Technojobz and others. Technojobz said: PHP interfaces and optional parameters <a href="http://dlvr.it/cTMr" >http://dlvr.it/cTMr</a> [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

