<?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: Tip #6: The importance of the default case</title> <atom:link href="http://victorhurdugaci.com/tip-6-the-importance-of-the-default-case/feed/" rel="self" type="application/rss+xml" /><link>http://victorhurdugaci.com/tip-6-the-importance-of-the-default-case/</link> <description>Victor Hurdugaci&#039;s playground</description> <lastBuildDate>Wed, 09 May 2012 17:30:08 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=</generator> <item><title>By: Dorin</title><link>http://victorhurdugaci.com/tip-6-the-importance-of-the-default-case/comment-page-1/#comment-898</link> <dc:creator>Dorin</dc:creator> <pubDate>Tue, 13 Oct 2009 06:39:20 +0000</pubDate> <guid
isPermaLink="false">http://victorhurdugaci.com/?p=1392#comment-898</guid> <description>Well, garbage is garbage anyway - if the memory gets corrupted, then you have a different problem, do you?:)</description> <content:encoded><![CDATA[<p>Well, garbage is garbage anyway &#8211; if the memory gets corrupted, then you have a different problem, do you?:)</p> ]]></content:encoded> </item> <item><title>By: Victor</title><link>http://victorhurdugaci.com/tip-6-the-importance-of-the-default-case/comment-page-1/#comment-893</link> <dc:creator>Victor</dc:creator> <pubDate>Mon, 12 Oct 2009 10:02:29 +0000</pubDate> <guid
isPermaLink="false">http://victorhurdugaci.com/?p=1392#comment-893</guid> <description>Dorin, in that case you need to check the variable after you finish with the switch. Switch goes very well with enums - that is true but if the memory gets corrupted and you have some garbage there?</description> <content:encoded><![CDATA[<p>Dorin, in that case you need to check the variable after you finish with the switch. Switch goes very well with enums &#8211; that is true but if the memory gets corrupted and you have some garbage there?</p> ]]></content:encoded> </item> <item><title>By: Dorin</title><link>http://victorhurdugaci.com/tip-6-the-importance-of-the-default-case/comment-page-1/#comment-892</link> <dc:creator>Dorin</dc:creator> <pubDate>Mon, 12 Oct 2009 06:04:51 +0000</pubDate> <guid
isPermaLink="false">http://victorhurdugaci.com/?p=1392#comment-892</guid> <description>Well, your code can be perfect if you take care of variable initialization.
For example, if you do a
color = 0x0;
switch (colid) {
case WHITE: color = 0xFFFFFF;
case BLUE: color = 0xFF0000;
etc.
}
Nobody will punish you.
Rule of thumb: switch goes very well with enums. :) And the compiler will notify you that you forgot a case or more (gcc does, at least, and any decent compiler should).</description> <content:encoded><![CDATA[<p>Well, your code can be perfect if you take care of variable initialization.<br
/> For example, if you do a<br
/> color = 0&#215;0;<br
/> switch (colid) {<br
/> case WHITE: color = 0xFFFFFF;<br
/> case BLUE: color = 0xFF0000;<br
/> etc.<br
/> }<br
/> Nobody will punish you.<br
/> Rule of thumb: switch goes very well with enums. :) And the compiler will notify you that you forgot a case or more (gcc does, at least, and any decent compiler should).</p> ]]></content:encoded> </item> </channel> </rss>
