<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Programming by Contract considered excessive</title>
	<link>http://blog.kriskemper.com/2008/08/11/programming-by-contract-considered-excessive/</link>
	<description>Thoughtworker, Agile Philosopher, Hero</description>
	<pubDate>Fri, 10 Sep 2010 13:33:21 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.2</generator>
		<item>
		<title>By: Null Handling Strategies at Mark Needham</title>
		<link>http://blog.kriskemper.com/2008/08/11/programming-by-contract-considered-excessive/#comment-255</link>
		<dc:creator>Null Handling Strategies at Mark Needham</dc:creator>
		<pubDate>Sat, 16 Aug 2008 00:05:31 +0000</pubDate>
		<guid>http://blog.kriskemper.com/2008/08/11/programming-by-contract-considered-excessive/#comment-255</guid>
		<description>[...] in an earlier post my dislike of the passing of null around code, and since then there have been a couple of posts on the subject on the ThoughtWorks [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] in an earlier post my dislike of the passing of null around code, and since then there have been a couple of posts on the subject on the ThoughtWorks [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kris Kemper</title>
		<link>http://blog.kriskemper.com/2008/08/11/programming-by-contract-considered-excessive/#comment-240</link>
		<dc:creator>Kris Kemper</dc:creator>
		<pubDate>Wed, 13 Aug 2008 01:05:46 +0000</pubDate>
		<guid>http://blog.kriskemper.com/2008/08/11/programming-by-contract-considered-excessive/#comment-240</guid>
		<description>Perhaps part of the reason I am biased against DBC is that I don't want to see getters that throw an exception because the application is not yet in a state to allow the getters to be called. This could be because there shouldn't be as many getters as there are in practice. I want to see a system that intelligently follows a valid state.

For instance, you ask, what to return in the case that we don't have something sensible to return - my standpoint is that in an internal codebase, the "client" (who is our own code) should make sure that they are able to get something when they try.

As an analogy with the vending machine is that we should not ask for a drink until we know that the vending machine has given one. If I had a Person object, I would probably argue that the Person should not try to get a drink from the vending machine until they knew that it had issued them one (or was ready to issue them one).</description>
		<content:encoded><![CDATA[<p>Perhaps part of the reason I am biased against DBC is that I don&#8217;t want to see getters that throw an exception because the application is not yet in a state to allow the getters to be called. This could be because there shouldn&#8217;t be as many getters as there are in practice. I want to see a system that intelligently follows a valid state.</p>
<p>For instance, you ask, what to return in the case that we don&#8217;t have something sensible to return - my standpoint is that in an internal codebase, the &#8220;client&#8221; (who is our own code) should make sure that they are able to get something when they try.</p>
<p>As an analogy with the vending machine is that we should not ask for a drink until we know that the vending machine has given one. If I had a Person object, I would probably argue that the Person should not try to get a drink from the vending machine until they knew that it had issued them one (or was ready to issue them one).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy</title>
		<link>http://blog.kriskemper.com/2008/08/11/programming-by-contract-considered-excessive/#comment-239</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Tue, 12 Aug 2008 18:24:11 +0000</pubDate>
		<guid>http://blog.kriskemper.com/2008/08/11/programming-by-contract-considered-excessive/#comment-239</guid>
		<description>Hi Kris,
Thanks for the response. :-)
My point is, what do we do when there is no sensible Object to return.
public Object foo(Object parameter) {
   if(weHaveSomethingSensibleToReturn()) {
     // just do stuff, and trust the other developers to be good citizens
     return sensibleObject;
   }
   else {
      // What do we do here? What do we need to do to be a good citizen?
   }
}
Object result = foo(parameter);

My feeling is that if we can't do something sensible, we should fail fast with the reason that we can't do it. I had already thought that it was a bit like Java assertions, but your comments have made me realise that I'm very much leaning towards DBC :-)
You are correct that it may be overkill in all situations.. I'll have to see how the workshop code turns out.</description>
		<content:encoded><![CDATA[<p>Hi Kris,<br />
Thanks for the response. <img src='http://blog.kriskemper.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
My point is, what do we do when there is no sensible Object to return.<br />
public Object foo(Object parameter) {<br />
   if(weHaveSomethingSensibleToReturn()) {<br />
     // just do stuff, and trust the other developers to be good citizens<br />
     return sensibleObject;<br />
   }<br />
   else {<br />
      // What do we do here? What do we need to do to be a good citizen?<br />
   }<br />
}<br />
Object result = foo(parameter);</p>
<p>My feeling is that if we can&#8217;t do something sensible, we should fail fast with the reason that we can&#8217;t do it. I had already thought that it was a bit like Java assertions, but your comments have made me realise that I&#8217;m very much leaning towards DBC <img src='http://blog.kriskemper.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
You are correct that it may be overkill in all situations.. I&#8217;ll have to see how the workshop code turns out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kris Kemper</title>
		<link>http://blog.kriskemper.com/2008/08/11/programming-by-contract-considered-excessive/#comment-237</link>
		<dc:creator>Kris Kemper</dc:creator>
		<pubDate>Tue, 12 Aug 2008 03:52:09 +0000</pubDate>
		<guid>http://blog.kriskemper.com/2008/08/11/programming-by-contract-considered-excessive/#comment-237</guid>
		<description>@Gavin

I liked your blog post on TDD vs DBC. I'm not unequivocally saying that one is better than the other. I am saying that in an internal codebase, there are far fewer benefits from in a published one, so few that I find it to be excessive.</description>
		<content:encoded><![CDATA[<p>@Gavin</p>
<p>I liked your blog post on TDD vs DBC. I&#8217;m not unequivocally saying that one is better than the other. I am saying that in an internal codebase, there are far fewer benefits from in a published one, so few that I find it to be excessive.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gavin Terrill</title>
		<link>http://blog.kriskemper.com/2008/08/11/programming-by-contract-considered-excessive/#comment-235</link>
		<dc:creator>Gavin Terrill</dc:creator>
		<pubDate>Tue, 12 Aug 2008 02:36:23 +0000</pubDate>
		<guid>http://blog.kriskemper.com/2008/08/11/programming-by-contract-considered-excessive/#comment-235</guid>
		<description>I'm not sure "enforcing a contract" is a bad thing. &lt;a href="http://fishdujour.typepad.com/blog/2008/07/testcontract-driven-development.html" rel="nofollow"&gt;I'm starting to think&lt;/a&gt; Contract Driven Development really has more to offer than we give it credit (assuming a decent implementation).</description>
		<content:encoded><![CDATA[<p>I&#8217;m not sure &#8220;enforcing a contract&#8221; is a bad thing. <a href="http://fishdujour.typepad.com/blog/2008/07/testcontract-driven-development.html" onclick="javascript:pageTracker._trackPageview('/outbound/comment/http://fishdujour.typepad.com/blog/2008/07/testcontract-driven-development.html');" rel="nofollow">I&#8217;m starting to think</a> Contract Driven Development really has more to offer than we give it credit (assuming a decent implementation).</p>
]]></content:encoded>
	</item>
</channel>
</rss>
