<?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: abolish the switch statement</title>
	<atom:link href="http://equivalence.co.uk/archives/99/feed" rel="self" type="application/rss+xml" />
	<link>http://equivalence.co.uk/archives/99</link>
	<description>Technical Blog for Software Developers</description>
	<lastBuildDate>Sat, 17 Mar 2012 10:28:25 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: Nice code and switches &#171; NRGsoft</title>
		<link>http://equivalence.co.uk/archives/99/comment-page-1#comment-1316</link>
		<dc:creator>Nice code and switches &#171; NRGsoft</dc:creator>
		<pubDate>Tue, 10 Jan 2012 11:48:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.equivalence.co.uk/?p=99#comment-1316</guid>
		<description>[...] I had a thought while I was working on the game Alone In the Office (my LudumDare 22 entry). I wonder if I can make this code look more beautiful. So I went through and refactored the code. Okay, so I cleaned it up. There was cleaning to be done. But, I wondered if I could find any useful tid-bits of information about what other people do to keep code nice. I found this article and I noticed B. B is to return the immediate value of a boolean test instead of testing if the boolean test returned true or false. Mind you, in certain cases you DO need to check. In the cases of some of my code, I did not. B is the one thing I apparently overlooked in programming over the years. It&#8217;s interesting how I never noticed it to say the least. Anyways, upon reading to the end I find this article. [...]</description>
		<content:encoded><![CDATA[<p>[...] I had a thought while I was working on the game Alone In the Office (my LudumDare 22 entry). I wonder if I can make this code look more beautiful. So I went through and refactored the code. Okay, so I cleaned it up. There was cleaning to be done. But, I wondered if I could find any useful tid-bits of information about what other people do to keep code nice. I found this article and I noticed B. B is to return the immediate value of a boolean test instead of testing if the boolean test returned true or false. Mind you, in certain cases you DO need to check. In the cases of some of my code, I did not. B is the one thing I apparently overlooked in programming over the years. It&#8217;s interesting how I never noticed it to say the least. Anyways, upon reading to the end I find this article. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gregg</title>
		<link>http://equivalence.co.uk/archives/99/comment-page-1#comment-124</link>
		<dc:creator>Gregg</dc:creator>
		<pubDate>Tue, 23 Dec 2008 11:27:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.equivalence.co.uk/?p=99#comment-124</guid>
		<description>Hi Donal, thanks for reading.

If you are given a string though you still have to create an enum at some point probably using a switch, if statement, or via the method in my post based on the string you have been given. No?  I should say though that I&#039;m not saying an if statement is much better, hence why I proposed doing away with both as per my example.</description>
		<content:encoded><![CDATA[<p>Hi Donal, thanks for reading.</p>
<p>If you are given a string though you still have to create an enum at some point probably using a switch, if statement, or via the method in my post based on the string you have been given. No?  I should say though that I&#8217;m not saying an if statement is much better, hence why I proposed doing away with both as per my example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Donal</title>
		<link>http://equivalence.co.uk/archives/99/comment-page-1#comment-120</link>
		<dc:creator>Donal</dc:creator>
		<pubDate>Tue, 23 Dec 2008 04:52:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.equivalence.co.uk/?p=99#comment-120</guid>
		<description>One example of where a switch statement is pretier than an if-else is when switching on enums. In fact, I would argue that in code such as that shown above, you should be using an enum, rather than a String, because of the extra type safety.

What makes a switch statement nicer than an if statement when branching based on an enum is that don&#039;t have to (in fact you can&#039;t) include the name of the enum in each branch.</description>
		<content:encoded><![CDATA[<p>One example of where a switch statement is pretier than an if-else is when switching on enums. In fact, I would argue that in code such as that shown above, you should be using an enum, rather than a String, because of the extra type safety.</p>
<p>What makes a switch statement nicer than an if statement when branching based on an enum is that don&#8217;t have to (in fact you can&#8217;t) include the name of the enum in each branch.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raghavan alias Saravanan M</title>
		<link>http://equivalence.co.uk/archives/99/comment-page-1#comment-111</link>
		<dc:creator>Raghavan alias Saravanan M</dc:creator>
		<pubDate>Thu, 18 Dec 2008 18:44:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.equivalence.co.uk/?p=99#comment-111</guid>
		<description>Hi there,

  That sounds pretty neat and I had been already game :). It more or less resembles the Factory Design Pattern and for sure its worth for the advantages we can think of!

  It might have had an overhead in prior to 1.5 versions of Java due to the absence of Auto boxing/unboxing though!

Cheers,
Raghavan alias Saravanan M.</description>
		<content:encoded><![CDATA[<p>Hi there,</p>
<p>  That sounds pretty neat and I had been already game <img src='http://equivalence.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . It more or less resembles the Factory Design Pattern and for sure its worth for the advantages we can think of!</p>
<p>  It might have had an overhead in prior to 1.5 versions of Java due to the absence of Auto boxing/unboxing though!</p>
<p>Cheers,<br />
Raghavan alias Saravanan M.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gregg</title>
		<link>http://equivalence.co.uk/archives/99/comment-page-1#comment-76</link>
		<dc:creator>Gregg</dc:creator>
		<pubDate>Fri, 12 Dec 2008 23:26:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.equivalence.co.uk/?p=99#comment-76</guid>
		<description>Thanks Peter, let&#039;s hope the credit crunch does&#039;nae bite ma bum too much and scupper ma plans.   Merry Christmas and a Happy New Year as well.</description>
		<content:encoded><![CDATA[<p>Thanks Peter, let&#8217;s hope the credit crunch does&#8217;nae bite ma bum too much and scupper ma plans.   Merry Christmas and a Happy New Year as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://equivalence.co.uk/archives/99/comment-page-1#comment-56</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Wed, 10 Dec 2008 00:02:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.equivalence.co.uk/?p=99#comment-56</guid>
		<description>Sounds good Gregg plenty of room for you to stay.Have a merry Christmas and a Happy New Year.</description>
		<content:encoded><![CDATA[<p>Sounds good Gregg plenty of room for you to stay.Have a merry Christmas and a Happy New Year.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gregg</title>
		<link>http://equivalence.co.uk/archives/99/comment-page-1#comment-49</link>
		<dc:creator>Gregg</dc:creator>
		<pubDate>Sun, 07 Dec 2008 21:25:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.equivalence.co.uk/?p=99#comment-49</guid>
		<description>Alas no time machine yet Peter ;-) .  Sorry about the rise in boffinness from the murky days of my old journal where scathing comment and drama was all the range, maybe someday I will bring it back elsewhere.  Anyway hope you are good, I&#039;m hoping to get over to the US next summer (canny afford Oz!) so if I go out near you I will drop you an email.</description>
		<content:encoded><![CDATA[<p>Alas no time machine yet Peter <img src='http://equivalence.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  .  Sorry about the rise in boffinness from the murky days of my old journal where scathing comment and drama was all the range, maybe someday I will bring it back elsewhere.  Anyway hope you are good, I&#8217;m hoping to get over to the US next summer (canny afford Oz!) so if I go out near you I will drop you an email.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Big Peter</title>
		<link>http://equivalence.co.uk/archives/99/comment-page-1#comment-48</link>
		<dc:creator>Big Peter</dc:creator>
		<pubDate>Sun, 07 Dec 2008 20:14:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.equivalence.co.uk/?p=99#comment-48</guid>
		<description>Whats all this then? they will have you on as one of those boffins on BBCS Tommorows World soon.Have you invented that time machine yet, thats what I am holding out for.Hope your well Gregg your old friend Peter...</description>
		<content:encoded><![CDATA[<p>Whats all this then? they will have you on as one of those boffins on BBCS Tommorows World soon.Have you invented that time machine yet, thats what I am holding out for.Hope your well Gregg your old friend Peter&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 7 ways to write beautiful code &#171; Kata learns to code</title>
		<link>http://equivalence.co.uk/archives/99/comment-page-1#comment-34</link>
		<dc:creator>7 ways to write beautiful code &#171; Kata learns to code</dc:creator>
		<pubDate>Fri, 05 Dec 2008 18:35:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.equivalence.co.uk/?p=99#comment-34</guid>
		<description>[...] is by no means an exhaustive list and I could have gone on longer - in fact my abolish the switch statement motto would have been number 8 if I had not already mentioned it before. However, it has to end [...]</description>
		<content:encoded><![CDATA[<p>[...] is by no means an exhaustive list and I could have gone on longer &#8211; in fact my abolish the switch statement motto would have been number 8 if I had not already mentioned it before. However, it has to end [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

