<?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: Zune death</title>
	<atom:link href="http://tech.puredanger.com/index.php/2009/01/02/zune-death/feed/" rel="self" type="application/rss+xml" />
	<link>http://tech.puredanger.com/2009/01/02/zune-death/</link>
	<description>Alex Miller&#039;s technical blog</description>
	<lastBuildDate>Mon, 06 Feb 2012 19:39:50 -0800</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
	<item>
		<title>By: Anonymous</title>
		<link>http://tech.puredanger.com/2009/01/02/zune-death/comment-page-1/#comment-130790</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Sun, 04 Jan 2009 14:46:04 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/2009/01/02/zune-death/#comment-130790</guid>
		<description>How many times is 10 minutes contained in one hour?

1 hour = 60 minutes, therefore,

60 minutes ÷ 10 minutes = 6

I have used simple division, but Zune uses repetitive subtractions to know the answer:

60 - 10 = 50 (1 time)
50 - 10 = 40 (2 times)
40 - 10 = 30 (3 times)
30 - 10 = 20 (4 times)
20 - 10 = 10 (5 times)
10 - 10 = 0  (6 times)

To know how many years are between a some known and convenient base date (for example January 1, 2000), and a a future date giving the elapsed days, we only have to divide by 365.2475:

days= modf (elapsedDays/ 365.2475, &amp;years);

it is only one line code.

And if we only have integer arithmetic, it can be done with a little more difficulty.

The bug with Zune is difficult to note because it isn&#039;t obvious, but the program logic is very ugly. Is Windows Vista coded in this bloated way?</description>
		<content:encoded><![CDATA[<p>How many times is 10 minutes contained in one hour?</p>
<p>1 hour = 60 minutes, therefore,</p>
<p>60 minutes ÷ 10 minutes = 6</p>
<p>I have used simple division, but Zune uses repetitive subtractions to know the answer:</p>
<p>60 &#8211; 10 = 50 (1 time)<br />
50 &#8211; 10 = 40 (2 times)<br />
40 &#8211; 10 = 30 (3 times)<br />
30 &#8211; 10 = 20 (4 times)<br />
20 &#8211; 10 = 10 (5 times)<br />
10 &#8211; 10 = 0  (6 times)</p>
<p>To know how many years are between a some known and convenient base date (for example January 1, 2000), and a a future date giving the elapsed days, we only have to divide by 365.2475:</p>
<p>days= modf (elapsedDays/ 365.2475, &amp;years);</p>
<p>it is only one line code.</p>
<p>And if we only have integer arithmetic, it can be done with a little more difficulty.</p>
<p>The bug with Zune is difficult to note because it isn&#8217;t obvious, but the program logic is very ugly. Is Windows Vista coded in this bloated way?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Walter Harley</title>
		<link>http://tech.puredanger.com/2009/01/02/zune-death/comment-page-1/#comment-130622</link>
		<dc:creator>Walter Harley</dc:creator>
		<pubDate>Sun, 04 Jan 2009 00:39:08 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/2009/01/02/zune-death/#comment-130622</guid>
		<description>This sort of confusion between &#039;count&#039; and &#039;index&#039; was one of the motivators of Charles Simonyi&#039;s original version of Hungarian notation (as distinct from the rightfully-derided, dumbed-down, unuseful version of Hungarian that was popularized in Petzold&#039;s Programming Windows book, and that appears in this sample).  The point of Simonyi&#039;s Hungarian was to efficiently convey datatype distinctions that the compiler can&#039;t know about, like the distinction between the size of an array and an index into the array, or between a count of pixels and a count of dialog units.

If the constants were named (e.g., DAYS_IN_LEAP_YEAR versus LAST_DAY_OF_LEAP_YEAR), and/or if the &quot;days&quot; variable were prefixed with something that indicated whether it is zero- or one-based, it would be easier to figure out what the code was supposed to do.  Code always tells you what it does do, but it doesn&#039;t always tell you what the developer thinks it should do.

Stepping back a bit: there are certain common confusions, and those (not others) are the ones that deserve comments.  Is an int value a sign or a count?  Is a C string null-terminated or not?  Can a pointer be null?  Does a window size include the borders?  Is a utility method reentrant?  What is the expected lifecycle of a class?  And so forth.  It&#039;s just amazing to me how often I see comments like &quot;determine whether it is a leap year&quot; before a call to isLeapYear(), versus how rarely I see comments that might actually be useful.

Stepping back even further: why does the Zune need to know what day it is, anyway?  I&#039;ve never had to set the clock on my CD player.</description>
		<content:encoded><![CDATA[<p>This sort of confusion between &#8216;count&#8217; and &#8216;index&#8217; was one of the motivators of Charles Simonyi&#8217;s original version of Hungarian notation (as distinct from the rightfully-derided, dumbed-down, unuseful version of Hungarian that was popularized in Petzold&#8217;s Programming Windows book, and that appears in this sample).  The point of Simonyi&#8217;s Hungarian was to efficiently convey datatype distinctions that the compiler can&#8217;t know about, like the distinction between the size of an array and an index into the array, or between a count of pixels and a count of dialog units.</p>
<p>If the constants were named (e.g., DAYS_IN_LEAP_YEAR versus LAST_DAY_OF_LEAP_YEAR), and/or if the &#8220;days&#8221; variable were prefixed with something that indicated whether it is zero- or one-based, it would be easier to figure out what the code was supposed to do.  Code always tells you what it does do, but it doesn&#8217;t always tell you what the developer thinks it should do.</p>
<p>Stepping back a bit: there are certain common confusions, and those (not others) are the ones that deserve comments.  Is an int value a sign or a count?  Is a C string null-terminated or not?  Can a pointer be null?  Does a window size include the borders?  Is a utility method reentrant?  What is the expected lifecycle of a class?  And so forth.  It&#8217;s just amazing to me how often I see comments like &#8220;determine whether it is a leap year&#8221; before a call to isLeapYear(), versus how rarely I see comments that might actually be useful.</p>
<p>Stepping back even further: why does the Zune need to know what day it is, anyway?  I&#8217;ve never had to set the clock on my CD player.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Burke</title>
		<link>http://tech.puredanger.com/2009/01/02/zune-death/comment-page-1/#comment-130404</link>
		<dc:creator>Eric Burke</dc:creator>
		<pubDate>Sat, 03 Jan 2009 01:09:13 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/2009/01/02/zune-death/#comment-130404</guid>
		<description>Also, the method says &quot;Returns TRUE if successful, otherwise returns FALSE.&quot;, but it looks like it always returns TRUE. Why return anything, if that&#039;s the case?

Anyway, looks a lot better than the code I have to maintain on a daily basis. :-(</description>
		<content:encoded><![CDATA[<p>Also, the method says &#8220;Returns TRUE if successful, otherwise returns FALSE.&#8221;, but it looks like it always returns TRUE. Why return anything, if that&#8217;s the case?</p>
<p>Anyway, looks a lot better than the code I have to maintain on a daily basis. :-(</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AMcguinn</title>
		<link>http://tech.puredanger.com/2009/01/02/zune-death/comment-page-1/#comment-130361</link>
		<dc:creator>AMcguinn</dc:creator>
		<pubDate>Fri, 02 Jan 2009 21:42:58 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/2009/01/02/zune-death/#comment-130361</guid>
		<description>Yes, I agree with Andrew &amp; Dave, the &gt;366 logic is correct, as the day is 1-based, otherwise it would be wrong every year.  It&#039;s meant to say if the day is after 365, then roll the year, unless it&#039;s a leap year and the day is not after 366.  But without the break it&#039;s going into an endless loop on the 31 dec of a leap year.</description>
		<content:encoded><![CDATA[<p>Yes, I agree with Andrew &amp; Dave, the &gt;366 logic is correct, as the day is 1-based, otherwise it would be wrong every year.  It&#8217;s meant to say if the day is after 365, then roll the year, unless it&#8217;s a leap year and the day is not after 366.  But without the break it&#8217;s going into an endless loop on the 31 dec of a leap year.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Latham</title>
		<link>http://tech.puredanger.com/2009/01/02/zune-death/comment-page-1/#comment-130325</link>
		<dc:creator>Dave Latham</dc:creator>
		<pubDate>Fri, 02 Jan 2009 19:43:02 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/2009/01/02/zune-death/#comment-130325</guid>
		<description>I think rather the innermost is clause should have an else { break; } in there.</description>
		<content:encoded><![CDATA[<p>I think rather the innermost is clause should have an else { break; } in there.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

