<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Coupling is NOT always bad</title>
	<link>http://tech.puredanger.com/2008/03/30/coupling-is-not-always-bad/</link>
	<description>Alex Miller's technical blog</description>
	<pubDate>Thu, 28 Aug 2008 03:28:19 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.2</generator>

	<item>
		<title>by: Ricky Clarkson</title>
		<link>http://tech.puredanger.com/2008/03/30/coupling-is-not-always-bad/#comment-35772</link>
		<pubDate>Mon, 31 Mar 2008 14:34:56 +0000</pubDate>
		<guid>http://tech.puredanger.com/2008/03/30/coupling-is-not-always-bad/#comment-35772</guid>
					<description>I'd just like to ask you all what the largest unit you'd feel comfortable coupling to is.

public static int identity(int i){ return i; } is the smallest unit I can think of.  Is it worth wrapping in an interface?  Does that actually decouple?

A more sensible example might be Math.abs() - it might be worth wrapping that in an interface so that you can one day replace it with StrictMath.abs().

Coupling is not bad, and should not give you an uncomfortable feeling, unless it stops you from doing things or makes them difficult.  If you *need* to use Math.abs() sometimes and StrictMath.abs() others, *then* decouple from the implementation.  With a decent IDE or a decent programming language it's trivial to make such a change.  YAGNI</description>
		<content:encoded><![CDATA[<p>I&#8217;d just like to ask you all what the largest unit you&#8217;d feel comfortable coupling to is.</p>
<p>public static int identity(int i){ return i; } is the smallest unit I can think of.  Is it worth wrapping in an interface?  Does that actually decouple?</p>
<p>A more sensible example might be Math.abs() - it might be worth wrapping that in an interface so that you can one day replace it with StrictMath.abs().</p>
<p>Coupling is not bad, and should not give you an uncomfortable feeling, unless it stops you from doing things or makes them difficult.  If you *need* to use Math.abs() sometimes and StrictMath.abs() others, *then* decouple from the implementation.  With a decent IDE or a decent programming language it&#8217;s trivial to make such a change.  YAGNI
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Alex</title>
		<link>http://tech.puredanger.com/2008/03/30/coupling-is-not-always-bad/#comment-35594</link>
		<pubDate>Sun, 30 Mar 2008 19:49:08 +0000</pubDate>
		<guid>http://tech.puredanger.com/2008/03/30/coupling-is-not-always-bad/#comment-35594</guid>
					<description>I thought the Internet was created to quibble about semantics? :)  I guess I'd say it's rather a difference in perspective but then maybe that's just semantics too.  ;)

I think my only disagreement with your comment is that sometimes I see reduced flexibility as a good thing if it improves things along other axes.  I see design as a multi-variable optimization problem and thus to me saying &quot;X is bad&quot; implies an absolutism that shuts off parts of the solution space, and I don't like that.

But I'm also willing to concede that I don't generally prefer that part of the solution space either and it's a good rule of thumb to explore other parts first.</description>
		<content:encoded><![CDATA[<p>I thought the Internet was created to quibble about semantics? :)  I guess I&#8217;d say it&#8217;s rather a difference in perspective but then maybe that&#8217;s just semantics too.  ;)</p>
<p>I think my only disagreement with your comment is that sometimes I see reduced flexibility as a good thing if it improves things along other axes.  I see design as a multi-variable optimization problem and thus to me saying &#8220;X is bad&#8221; implies an absolutism that shuts off parts of the solution space, and I don&#8217;t like that.</p>
<p>But I&#8217;m also willing to concede that I don&#8217;t generally prefer that part of the solution space either and it&#8217;s a good rule of thumb to explore other parts first.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Vidar Hokstad</title>
		<link>http://tech.puredanger.com/2008/03/30/coupling-is-not-always-bad/#comment-35592</link>
		<pubDate>Sun, 30 Mar 2008 19:31:44 +0000</pubDate>
		<guid>http://tech.puredanger.com/2008/03/30/coupling-is-not-always-bad/#comment-35592</guid>
					<description>We agree. You're quibbling about semantics. To me coupling is always bad, but that doesn't mean the downsides can't be outweighed because of other benefits. 

To me, no matter what the benefits there is still value in trying to reduce the coupling, because every bit of coupling means less flexibility. Sometimes you can't, and often the coupling is necessary to achieve your goals - hence why I devoted a big chunk of my post to point out that there are lots of cases where even tighter coupling than the minimum achievable is worthwhile.

So our only disagreement is whether or not the fact that it's sometimes necessary to increase coupling to get the maximum benefits means that the coupling isn't bad or that it still is bad but is worth it. That's mainly a matter of wording. I choose to see it as being bad because it reinforces that increased coupling always as a cost that you need to keep in mind.</description>
		<content:encoded><![CDATA[<p>We agree. You&#8217;re quibbling about semantics. To me coupling is always bad, but that doesn&#8217;t mean the downsides can&#8217;t be outweighed because of other benefits. </p>
<p>To me, no matter what the benefits there is still value in trying to reduce the coupling, because every bit of coupling means less flexibility. Sometimes you can&#8217;t, and often the coupling is necessary to achieve your goals - hence why I devoted a big chunk of my post to point out that there are lots of cases where even tighter coupling than the minimum achievable is worthwhile.</p>
<p>So our only disagreement is whether or not the fact that it&#8217;s sometimes necessary to increase coupling to get the maximum benefits means that the coupling isn&#8217;t bad or that it still is bad but is worth it. That&#8217;s mainly a matter of wording. I choose to see it as being bad because it reinforces that increased coupling always as a cost that you need to keep in mind.
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
