<?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: Develop for the Next Guy</title>
	<atom:link href="http://timkadlec.com/2008/01/develop-for-the-next-guy/feed/" rel="self" type="application/rss+xml" />
	<link>http://timkadlec.com/2008/01/develop-for-the-next-guy/</link>
	<description>A Wisconsin based web developer writing about the web.</description>
	<lastBuildDate>Sat, 21 Jan 2012 04:29:25 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Tim Kadlec</title>
		<link>http://timkadlec.com/2008/01/develop-for-the-next-guy/comment-page-1/#comment-41</link>
		<dc:creator>Tim Kadlec</dc:creator>
		<pubDate>Thu, 31 Jan 2008 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://localhost/1969/12/develop-for-the-next-guy/#comment-41</guid>
		<description>Thanks for the comment Ian!&lt;br /&gt;&lt;br /&gt;You are absolutely right, as with most techniques on this list, you need to be sure we don&#039;t go overboard. It comes down to knowing how to use these techniques efficiently.</description>
		<content:encoded><![CDATA[<p>Thanks for the comment Ian!</p>
<p>You are absolutely right, as with most techniques on this list, you need to be sure we don&#8217;t go overboard. It comes down to knowing how to use these techniques efficiently.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Seth Petry-Johnson</title>
		<link>http://timkadlec.com/2008/01/develop-for-the-next-guy/comment-page-1/#comment-38</link>
		<dc:creator>Seth Petry-Johnson</dc:creator>
		<pubDate>Tue, 29 Jan 2008 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://localhost/1969/12/develop-for-the-next-guy/#comment-38</guid>
		<description>&gt; Make sure your methods are flexible and can be used in a variety &lt;br /&gt;&gt; of different ways.&lt;br /&gt;&lt;br /&gt;I understand the point you&#039;re making (and agree), but I think the way you&#039;ve stated it is misleading. The goal is to make sure methods perform a SINGLE logical operation or task that is easily described [i.e. high cohesion]. Doing this usually LEADS TO flexibility, because the code is highly portable and re-usable, but the methods themselves are not necessarily flexible.&lt;br /&gt;&lt;br /&gt;Creating methods to be flexible can often REDUCE cohesion. Using your example, for instance, I might create a more flexible method like this:&lt;br /&gt;&lt;br /&gt;function getName(employee, outputType) { ... }&lt;br /&gt;&lt;br /&gt;where outputType contains some flag like &#039;show_alert&#039; or &#039;inner_html&#039; that my code uses to pick alternate means of displaying the data. This code is certainly flexible and can easily be extended, but it is obviously a poor design choice. Your second getName() example shows the correct approach, which provides flexibility by decoupling the mechanism of obtaining the name from the mechanism using the name.&lt;br /&gt;&lt;br /&gt;I know we&#039;re saying the same thing, I&#039;ve just seen too much bad code written by developers focusing on &#039;flexibility&#039; at the expense of other, more important concerns :)</description>
		<content:encoded><![CDATA[<p>> Make sure your methods are flexible and can be used in a variety <br />> of different ways.</p>
<p>I understand the point you&#8217;re making (and agree), but I think the way you&#8217;ve stated it is misleading. The goal is to make sure methods perform a SINGLE logical operation or task that is easily described [i.e. high cohesion]. Doing this usually LEADS TO flexibility, because the code is highly portable and re-usable, but the methods themselves are not necessarily flexible.</p>
<p>Creating methods to be flexible can often REDUCE cohesion. Using your example, for instance, I might create a more flexible method like this:</p>
<p>function getName(employee, outputType) { &#8230; }</p>
<p>where outputType contains some flag like &#8216;show_alert&#8217; or &#8216;inner_html&#8217; that my code uses to pick alternate means of displaying the data. This code is certainly flexible and can easily be extended, but it is obviously a poor design choice. Your second getName() example shows the correct approach, which provides flexibility by decoupling the mechanism of obtaining the name from the mechanism using the name.</p>
<p>I know we&#8217;re saying the same thing, I&#8217;ve just seen too much bad code written by developers focusing on &#8216;flexibility&#8217; at the expense of other, more important concerns :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim Kadlec</title>
		<link>http://timkadlec.com/2008/01/develop-for-the-next-guy/comment-page-1/#comment-39</link>
		<dc:creator>Tim Kadlec</dc:creator>
		<pubDate>Tue, 29 Jan 2008 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://localhost/1969/12/develop-for-the-next-guy/#comment-39</guid>
		<description>Good point Seth! There&#039;s always more than one way to accomplish a goal. We want our code to be flexible, but it&#039;s important to make sure we are using high cohesion methods to accomplish this. Doing so will result in better reusability and extendibility.</description>
		<content:encoded><![CDATA[<p>Good point Seth! There&#8217;s always more than one way to accomplish a goal. We want our code to be flexible, but it&#8217;s important to make sure we are using high cohesion methods to accomplish this. Doing so will result in better reusability and extendibility.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian Hickman</title>
		<link>http://timkadlec.com/2008/01/develop-for-the-next-guy/comment-page-1/#comment-40</link>
		<dc:creator>Ian Hickman</dc:creator>
		<pubDate>Tue, 29 Jan 2008 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://localhost/1969/12/develop-for-the-next-guy/#comment-40</guid>
		<description>Good post.&lt;br /&gt;&lt;br /&gt;Comments also be used to separate off blocks of code.  Every syntax highlighting editor will draw the comment line in a separate colour so tactical commenting can also be a good, visual way of breaking up the code.&lt;br /&gt;&lt;br /&gt;You can go too far though, commenting every single line makes code far more difficult to read.&lt;br /&gt;</description>
		<content:encoded><![CDATA[<p>Good post.</p>
<p>Comments also be used to separate off blocks of code.  Every syntax highlighting editor will draw the comment line in a separate colour so tactical commenting can also be a good, visual way of breaking up the code.</p>
<p>You can go too far though, commenting every single line makes code far more difficult to read.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

