

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Plastic/Blog &#187; code smell</title>
	<atom:link href="http://blog.codiceplastico.com/index.php/tag/code-smell/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.codiceplastico.com</link>
	<description>Code Elegance</description>
	<lastBuildDate>Sat, 28 Aug 2010 10:27:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Are we sure that goto is dead?</title>
		<link>http://blog.codiceplastico.com/index.php/2009/03/12/are-we-sure-that-goto-is-dead/</link>
		<comments>http://blog.codiceplastico.com/index.php/2009/03/12/are-we-sure-that-goto-is-dead/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 19:57:07 +0000</pubDate>
		<dc:creator>Emanuele DelBono</dc:creator>
				<category><![CDATA[Emanuele DelBono]]></category>
		<category><![CDATA[code smell]]></category>
		<category><![CDATA[Design]]></category>

		<guid isPermaLink="false">http://blog.codiceplastico.com/?p=208</guid>
		<description><![CDATA[Last week, during a code review I found this code (I cut some lines to keep the post short) &#160; // [Cut] case USER_AGENT: // [Cut]...various code.... goto default; //we want it to be added to serverVariables case CONTENT_TYPE: // [Cut]...more code (with some &#34;if&#34;) goto default; //we want it to be added to serverVariables [...]]]></description>
			<content:encoded><![CDATA[<p>Last week, during a code review I found this code (I cut some lines to keep the post short)</p>
<p>&#160;</p>
<div>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #008000">// [Cut]</span>
<span style="color: #0000ff">case</span> USER_AGENT:
     <span style="color: #008000">// [Cut]...various code....</span>
     <span style="color: #0000ff">goto</span> <span style="color: #0000ff">default</span>; <span style="color: #008000">//we want it to be added to serverVariables</span>
<span style="color: #0000ff">case</span> CONTENT_TYPE:
     <span style="color: #008000">// [Cut]...more code (with some &quot;if&quot;)</span>
     <span style="color: #0000ff">goto</span> <span style="color: #0000ff">default</span>; <span style="color: #008000">//we want it to be added to serverVariables</span>
 <span style="color: #0000ff">case</span> USER_LANGUAGE:
     ParseUserLanguage(variableValue);
     <span style="color: #0000ff">break</span>;
 <span style="color: #0000ff">default</span>:
     ServerVariables.Add(variableName, variableValue);
     <span style="color: #0000ff">break</span>;
<span style="color: #008000">// [Cut]...continue...</span></pre>
</div>
<p>No words.</p>
<p>&#160;</p>
<div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:48c43526-0b5a-403f-8741-acd50856d8ba" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">Technorati Tags: <a href="http://technorati.com/tags/Design" rel="tag">Design</a>,<a href="http://technorati.com/tags/Coding" rel="tag">Coding</a>,<a href="http://technorati.com/tags/goto" rel="tag">goto</a></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.codiceplastico.com/index.php/2009/03/12/are-we-sure-that-goto-is-dead/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The smell of Copy&amp;Paste</title>
		<link>http://blog.codiceplastico.com/index.php/2009/01/29/the-smell-of-copypaste/</link>
		<comments>http://blog.codiceplastico.com/index.php/2009/01/29/the-smell-of-copypaste/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 18:27:28 +0000</pubDate>
		<dc:creator>Emanuele DelBono</dc:creator>
				<category><![CDATA[Emanuele DelBono]]></category>
		<category><![CDATA[code smell]]></category>
		<category><![CDATA[Design]]></category>

		<guid isPermaLink="false">http://blog.codiceplastico.com/?p=192</guid>
		<description><![CDATA[I often read phrases like these &#8220;adding a new module to our application is very simple, just copy&#38;paste some code&#8221; or &#8220;to create a new class you have to copy&#38;paste from an old class&#8221;. In my opinion this there is something wrong about this. Copy&#38;Paste is a smell. If you need the Copy&#38;Paste to add [...]]]></description>
			<content:encoded><![CDATA[<p>I often read phrases like these &#8220;adding a new module to our application is very simple, just copy&amp;paste some code&#8221; or &#8220;to create a new class you have to copy&amp;paste from an old class&#8221;. In my opinion this there is something wrong about this. Copy&amp;Paste is a smell. If you need the Copy&amp;Paste to add some functionality to your application means that you are duplicating your code and then you will be in trouble when you need to  maintain it.</p>
<p>What could you do? When the second Copy&amp;Paste happens, stop, read your code, extract a class and &#8220;<a href="http://www.google.com/search?q=encapsulate+what+varies"><span style="color: #71bed2;">encapsulate what varies</span></a>&#8220;.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codiceplastico.com/index.php/2009/01/29/the-smell-of-copypaste/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
