<?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>Jesus Blog &#187; Bad Code</title>
	<atom:link href="http://jesus-blog.com/category/bad-code/feed" rel="self" type="application/rss+xml" />
	<link>http://jesus-blog.com</link>
	<description>Jesus-blog.com</description>
	<lastBuildDate>Thu, 13 Jan 2011 19:07:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Bad Code</title>
		<link>http://jesus-blog.com/bad-code/bad-code.html</link>
		<comments>http://jesus-blog.com/bad-code/bad-code.html#comments</comments>
		<pubDate>Thu, 08 Oct 2009 11:19:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bad Code]]></category>
		<category><![CDATA[Opinions]]></category>

		<guid isPermaLink="false">http://blog.nathanwhitworth.co.uk/?p=112</guid>
		<description><![CDATA[Further to my last post about the quality of code in certain well known PHP projects, I just stumbled across this fantastically pointless finger spew.

function the_title($before = '', $after = '', $echo = true) {
$title = get_the_title();
if ( strlen($title) == 0 )
return;
$title = $before . $title . $after;
if ( $echo )
echo $title;
else
return $title;
}
How entirely pointless [...]]]></description>
			<content:encoded><![CDATA[<p>Further to my last post about the quality of code in certain well known PHP projects, I just stumbled across this fantastically pointless finger spew.</p>
<p><code><br />
function the_title($before = '', $after = '', $echo = true) {<br />
$title = get_the_title();</code></p>
<p>if ( strlen($title) == 0 )<br />
return;</p>
<p>$title = $before . $title . $after;</p>
<p>if ( $echo )<br />
echo $title;<br />
else<br />
return $title;<br />
}</p>
<p>How entirely pointless that is, indeed, it gets worse, the entire thing is bloody well restrictive.<br />
<code>$title = get_the_title();</code> goes off and gets the title, but it adds HTML to it. I just want to get the title, but instead I end up getting &lt;span blah blah&gt;TITLE&lt;/span&gt;.</p>
<p>Very poor code folks, and I think the naming conventions for the functions are not even worth commenting about&#8230; oh go on, I can&#8217;t resist &#8220;the _title&#8221;? Nice and descriptive, ain&#8217;t it. <img src='http://jesus-blog.com/wp-includes/images/smilies/icon_neutral.gif' alt=':|' class='wp-smiley' /> </p>
<p>The thing is, I cannot understand why somebody would have done this. It&#8217;s just adding code that is in no way required. I think you&#8217;ll find that this particular program is riddled with dodgy designs, or lack thereof, like this, and if it was just coded properly in the first place, I dare say it would run considerably quicker, not to mention making the lives of us developers infinitely easier.</p>
]]></content:encoded>
			<wfw:commentRss>http://jesus-blog.com/bad-code/bad-code.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

