<?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/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>break Archives - Pietari Heino&#039;s personal website</title>
	<atom:link href="https://www.extreg.com/blog/tag/break/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.extreg.com</link>
	<description></description>
	<lastBuildDate>Mon, 06 Mar 2017 18:12:13 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.6.7</generator>
<site xmlns="com-wordpress:feed-additions:1">99365322</site>	<item>
		<title>Switch is evil</title>
		<link>https://www.extreg.com/blog/2017/03/switch-is-evil/</link>
					<comments>https://www.extreg.com/blog/2017/03/switch-is-evil/#respond</comments>
		
		<dc:creator><![CDATA[Pietari]]></dc:creator>
		<pubDate>Mon, 06 Mar 2017 18:12:13 +0000</pubDate>
				<category><![CDATA[random]]></category>
		<category><![CDATA[break]]></category>
		<category><![CDATA[evil]]></category>
		<category><![CDATA[switch]]></category>
		<guid isPermaLink="false">https://extreg.com/?p=160</guid>

					<description><![CDATA[<p>I have a game project at the Uni. We&#8217;re implementing it in Java. I&#8217;ve never done any real Java except for some Android and Hadoop playing around. But you know, I know the syntax&#8230; eh. I needed a switch. I thought I really shouldn&#8217;t use a switch since every time I&#8217;ve used one there has been a ... <span class="more"><a class="more-link" href="https://www.extreg.com/blog/2017/03/switch-is-evil/">[Read more...]</a></span></p>
<p>The post <a rel="nofollow" href="https://www.extreg.com/blog/2017/03/switch-is-evil/">Switch is evil</a> appeared first on <a rel="nofollow" href="https://www.extreg.com">Pietari Heino&#039;s personal website</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I have a game project at the Uni. We&#8217;re implementing it in Java. I&#8217;ve never done any real Java except for some Android and Hadoop playing around. But you know, <em>I know the syntax&#8230; </em>eh.</p>
<p>I needed a switch. I thought I really shouldn&#8217;t use a switch since every time I&#8217;ve used one there has been a bug somewhere in there. Either in the first implementation of the code or some later iteration when I&#8217;ve added or removed something. That&#8217;s the toughest case (pun intended!): you touch your working switch. There&#8217;s always been something that breaks and it has been hard to spot. So <em>this in mind </em>I opened Java reference and looked up the syntax. I glanced over it and paid some careful attention to the break statements. I implemented my switch and it worked. I added more cases and it didn&#8217;t. I spent ~10 minutes locating the bug. The bug wasn&#8217;t obviously connected to the switch and I actually was pretty sure it had something to do with another part of the code that was called after this new version of my switch. Then it hit me.</p>
<p>I had forgot the breaks.</p>
<p>I laughed and decided to write this. Really. I opened the Java reference <strong><em>thinking that I really really shouldn&#8217;t use a switch</em></strong> and examined the examples carefully not to miss how the breaks and defaults etc. should work. And I forogot the breaks.</p>
<p>Don&#8217;t use a switch.</p>
<p>The post <a rel="nofollow" href="https://www.extreg.com/blog/2017/03/switch-is-evil/">Switch is evil</a> appeared first on <a rel="nofollow" href="https://www.extreg.com">Pietari Heino&#039;s personal website</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.extreg.com/blog/2017/03/switch-is-evil/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">160</post-id>	</item>
	</channel>
</rss>
