<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Why boxing doesn't keep me awake at nights</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/10/08/why-boxing-doesn-t-keep-me-awake-at-nights.aspx</link><description>I&amp;#39;m currently reading the (generally excellent) CLR via C# , and I&amp;#39;ve recently hit the section on boxing. Why is it that authors feel they have to scaremonger about the effects boxing can have on performance? Here&amp;#39;s a piece of code from the</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>re: Why boxing doesn't keep me awake at nights</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/10/08/why-boxing-doesn-t-keep-me-awake-at-nights.aspx#1653064</link><pubDate>Tue, 04 Nov 2008 20:54:18 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1653064</guid><dc:creator>Konrad</dc:creator><description>&lt;p&gt;Where&amp;#39;s the upvote button? ;-)&lt;/p&gt;
&lt;p&gt;This is the kind of benchmarks that I like to read: actually comparing different factors that might have an influence. This can definitely serve as a reference for future discussions.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1653064" width="1" height="1"&gt;</description></item><item><title>re: Why boxing doesn't keep me awake at nights</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/10/08/why-boxing-doesn-t-keep-me-awake-at-nights.aspx#1652887</link><pubDate>Mon, 03 Nov 2008 07:48:41 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1652887</guid><dc:creator>skeet</dc:creator><description>&lt;p&gt;@Anon: Generics has *far* bigger benefits in terms of exressiveness than the benefit of avoiding boxing. (Note that Java introduced generics without the benefits that C# has in terms of performance.)&lt;/p&gt;
&lt;p&gt;I doubt that many developers *really* hit a &amp;quot;roadblock&amp;quot; due to boxing. They may have hit a conceptual roadblock, but rarely a performance one. Yes, it hurts performance - but rarely enough to actually stop you making progress.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1652887" width="1" height="1"&gt;</description></item><item><title>re: Why boxing doesn't keep me awake at nights</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/10/08/why-boxing-doesn-t-keep-me-awake-at-nights.aspx#1652864</link><pubDate>Mon, 03 Nov 2008 01:42:18 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1652864</guid><dc:creator>Anon</dc:creator><description>&lt;p&gt;Apparently though C# language designers felt that boxing was a big enough issue to introduce generics. Maybe boxing doesn&amp;#39;t keep you awake at night (anymore) but it used to, at least a little.&lt;/p&gt;
&lt;p&gt;Boxing is important, and many developers hit a roadblock because they don&amp;#39;t understand it.&lt;/p&gt;
&lt;p&gt;String concatenations instead of string builders still keep me up at night too.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1652864" width="1" height="1"&gt;</description></item><item><title>re: Why boxing doesn't keep me awake at nights</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/10/08/why-boxing-doesn-t-keep-me-awake-at-nights.aspx#1651387</link><pubDate>Mon, 20 Oct 2008 13:40:27 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1651387</guid><dc:creator>Matt</dc:creator><description>&lt;p&gt;Hello all,&lt;/p&gt;
&lt;p&gt;I wrote a performance test to see what kind of results I would get. &amp;nbsp;On my machine I find the overhead of boxing to be negligable (on average 20ms when performing 1 million boxing operations).&lt;/p&gt;
&lt;p&gt;I thought I&amp;#39;d share my code listing and open myself up to any comments... &amp;nbsp;I&amp;#39;d also like to know if anyone knows if there are any compiler performance optimisations being enforced that are skewing my results.&lt;/p&gt;
&lt;p&gt;Let me know what you guys think. :)&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Matt&lt;/p&gt;
&lt;p&gt;---------------&lt;/p&gt;
&lt;p&gt;//define how many boxing operation we will perform&lt;/p&gt;
&lt;p&gt;const int LOOPS = 1000000;&lt;/p&gt;
&lt;p&gt;//an object to box to&lt;/p&gt;
&lt;p&gt;static object testObject;&lt;/p&gt;
&lt;p&gt;//an object to not box to&lt;/p&gt;
&lt;p&gt;static double testDouble;&lt;/p&gt;
&lt;p&gt;//a random generator&lt;/p&gt;
&lt;p&gt;static Random random = new Random();&lt;/p&gt;
&lt;p&gt;/// &amp;lt;summary&amp;gt;&lt;/p&gt;
&lt;p&gt;/// Gets a list of random numbers, so we can use random numbers but move their&lt;/p&gt;
&lt;p&gt;/// overhead to a non critical execution time.&lt;/p&gt;
&lt;p&gt;/// &amp;lt;/summary&amp;gt;&lt;/p&gt;
&lt;p&gt;private static List&amp;lt;double&amp;gt; getRandomNumbers()&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;//create a list to store the results in&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;List&amp;lt;double&amp;gt; result = new List&amp;lt;double&amp;gt;();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;//create enough random numbers for the box test&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;for (int loop = 0; loop &amp;lt; LOOPS; loop++)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//record the numbers&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;result.Add(random.NextDouble());&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;//return our random numbers&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;return result;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;/// &amp;lt;summary&amp;gt;&lt;/p&gt;
&lt;p&gt;/// Performs a test to determine the overhead caused by boxing.&lt;/p&gt;
&lt;p&gt;/// &amp;lt;/summary&amp;gt;&lt;/p&gt;
&lt;p&gt;static double boxTest()&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;//get a list of random numbers&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;var randomNumbers = getRandomNumbers();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;//record the start time&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;var start = DateTime.Now;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;//go through all the random numbers&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;foreach(var randomNumber in randomNumbers)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//perform an assignment without boxing&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;testDouble = randomNumber;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;//record the duration of the &amp;quot;non boxing&amp;quot; example&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;var nonBoxDuration = DateTime.Now - start;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;//reset the start time&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;start = DateTime.Now;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;//go through all the random numbers&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;foreach (var randomNumber in randomNumbers)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//perform an assignment with boxing&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;testObject = (object)randomNumber;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;//record the duration of the boxing example&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;var boxDuration = DateTime.Now - start;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;//return the difference in milliseconds&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;return boxDuration.TotalMilliseconds - nonBoxDuration.TotalMilliseconds;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;/// &amp;lt;summary&amp;gt;&lt;/p&gt;
&lt;p&gt;/// Performs the box test multiple times and performs a list of the results in milliseconds.&lt;/p&gt;
&lt;p&gt;/// &amp;lt;/summary&amp;gt;&lt;/p&gt;
&lt;p&gt;private static List&amp;lt;double&amp;gt; getBoxTestResults()&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;//make a list to record the results&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;List&amp;lt;double&amp;gt; results = new List&amp;lt;double&amp;gt;();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;//perform the box test 1000 times and record the result&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;for (int loop = 0; loop &amp;lt; 100; loop++)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//add the box test result to our list of results&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;results.Add(boxTest());&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;//return the results&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;return results;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;/// &amp;lt;summary&amp;gt;&lt;/p&gt;
&lt;p&gt;/// The Main entry point of the program.&lt;/p&gt;
&lt;p&gt;/// &amp;lt;/summary&amp;gt;&lt;/p&gt;
&lt;p&gt;static void Main(string[] args)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;//get the box test results&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;var boxTestResults = getBoxTestResults();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;//get the maximum difference (ms)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;var max = boxTestResults.Max();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;//get the minimum difference (ms)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;var min = boxTestResults.Min();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;//get the average difference (ms)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;var average = boxTestResults.Average();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;//output the results&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Console.WriteLine(&amp;quot;Max: {0}, Min: {1}, Avg: {2}&amp;quot;, max, min, average);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1651387" width="1" height="1"&gt;</description></item><item><title>re: Why boxing doesn't keep me awake at nights</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/10/08/why-boxing-doesn-t-keep-me-awake-at-nights.aspx#1651370</link><pubDate>Mon, 20 Oct 2008 08:47:35 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1651370</guid><dc:creator>Matthew Jones</dc:creator><description>&lt;p&gt;@Granville, I personally do not have time to read many books. &amp;nbsp;I tend to spend time skimming topics online, and then interrogating ones I find of interest further. &amp;nbsp;If I do manage to find time to read an educational text I certainly wouldn&amp;#39;t then seek to read another 5 on exatly the same subject just to see if they all correlate. &amp;nbsp;When one&amp;#39;s time is at such a premium it is simply not possible to validate every morcel of information. &amp;nbsp;When I attend a seminar or purchase an educational text I am paying for a service that I expect to deliver accurate information.&lt;/p&gt;
&lt;p&gt;I do concur that readers should try to take things with a pinch of salt when reading around a subject. &amp;nbsp;When dealing with a topic as subjective as performance the author should provide some quantative information to back up his or her claims. &amp;nbsp;This will aid the reader by providing a context against which an opinion can be formed.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1651370" width="1" height="1"&gt;</description></item><item><title>Why should I use List&lt;T&gt; and not ArrayList</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/10/08/why-boxing-doesn-t-keep-me-awake-at-nights.aspx#1650445</link><pubDate>Fri, 10 Oct 2008 11:34:14 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1650445</guid><dc:creator>Helper Code</dc:creator><description>&lt;p&gt;I came upon a questing at StackOverflow : The system I work on here was written before .net 2.0 and didn&amp;#39;t&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1650445" width="1" height="1"&gt;</description></item><item><title>re: Why boxing doesn't keep me awake at nights</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/10/08/why-boxing-doesn-t-keep-me-awake-at-nights.aspx#1650388</link><pubDate>Thu, 09 Oct 2008 22:20:16 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1650388</guid><dc:creator>skeet</dc:creator><description>&lt;p&gt;Ben: Absolutely. It should have been called &amp;quot;SINGLE_BOX&amp;quot; or something like that. I noticed it after I&amp;#39;d already done everything else, I&amp;#39;m afraid :(&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1650388" width="1" height="1"&gt;</description></item><item><title>re: Why boxing doesn't keep me awake at nights</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/10/08/why-boxing-doesn-t-keep-me-awake-at-nights.aspx#1650385</link><pubDate>Thu, 09 Oct 2008 21:59:23 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1650385</guid><dc:creator>Ben Voigt [C++ MVP]</dc:creator><description>&lt;p&gt;Ummm, I think the _NO_BOXING version is misnamed. &amp;nbsp;Surely this line:&lt;/p&gt;
&lt;p&gt;object o = i;&lt;/p&gt;
&lt;p&gt;involves boxing?&lt;/p&gt;
&lt;p&gt;Of course the new C++0x variable template typeargs will put an end to this discussion for a while (because all the ToString calls inside Format can be statically bound to the correct version in the C++0x version and even inlined). &amp;nbsp;This will give the first version the performance of the last one. &amp;nbsp;Well, maybe only the FORMAT_STRINGS version, still over 3x faster.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1650385" width="1" height="1"&gt;</description></item><item><title>re: Why boxing doesn't keep me awake at nights</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/10/08/why-boxing-doesn-t-keep-me-awake-at-nights.aspx#1650350</link><pubDate>Thu, 09 Oct 2008 17:25:37 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1650350</guid><dc:creator>Granville Barnett</dc:creator><description>&lt;p&gt;@David - I look at books as being a catalyst for further investigation. &lt;/p&gt;
&lt;p&gt;Maybe my approach is this because the books I tend to read are not as clear cut like most programming books are. This is just the way I feel about them in general.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1650350" width="1" height="1"&gt;</description></item><item><title>re: Why boxing doesn't keep me awake at nights</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/10/08/why-boxing-doesn-t-keep-me-awake-at-nights.aspx#1650324</link><pubDate>Thu, 09 Oct 2008 14:42:10 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1650324</guid><dc:creator>David Nelson</dc:creator><description>&lt;p&gt;@Chris, Granville&lt;/p&gt;
&lt;p&gt;Of course you cannot take everything you read in a book as 100% gospel; even good authors sometimes make mistakes and are sometimes just plain wrong.&lt;/p&gt;
&lt;p&gt;But at the same time, part of the reason that developers read books is that there is way more out there to learn than they could ever possibly learn on their own through experimentation. The software world is expanding far too quickly, no more so than in the .NET space. So developers read books by people who are supposedly already experienced in a particular topic as an efficient way of assimilating new information. If the author is wrong, or is exaggerating, then the reader is assimilating WRONG information, which undermines the point of reading the book in the first place. Sure, the reader could go out and verify everything he reads for himself, but then what is the point of reading the book?&lt;/p&gt;
&lt;p&gt;That is why it is so important for authors to make every effort to be as accurate as possible; like it or not, what they say is often the first and possibly the last impression that a developer will get on a particular subject, and if they care at all about being positive contributors to the development community, they need to do their best to make sure that impression is the right one.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1650324" width="1" height="1"&gt;</description></item><item><title>re: Why boxing doesn't keep me awake at nights</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/10/08/why-boxing-doesn-t-keep-me-awake-at-nights.aspx#1650319</link><pubDate>Thu, 09 Oct 2008 13:24:03 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1650319</guid><dc:creator>skeet</dc:creator><description>&lt;p&gt;Yup, that&amp;#39;s the book I&amp;#39;ll be getting when it&amp;#39;s available in the US. I think they&amp;#39;ve changed the title though - it used to include the word &amp;quot;Annotated&amp;quot; right there.&lt;/p&gt;
&lt;p&gt;I already have the 2.0 edition, signed by Anders, Scott and Peter :)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1650319" width="1" height="1"&gt;</description></item><item><title>re: Why boxing doesn't keep me awake at nights</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/10/08/why-boxing-doesn-t-keep-me-awake-at-nights.aspx#1650316</link><pubDate>Thu, 09 Oct 2008 13:16:12 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1650316</guid><dc:creator>Granville Barnett</dc:creator><description>&lt;p&gt;I&amp;#39;ve just realised that its not the the 10th of October yet ;-( Sorry, shows how out of touch I am with days/dates at the moment.&lt;/p&gt;
&lt;p&gt;So, Safari has it right now (electronic of course) available but Amazon (US, print) says its not out until the 20th of this month.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1650316" width="1" height="1"&gt;</description></item><item><title>re: Why boxing doesn't keep me awake at nights</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/10/08/why-boxing-doesn-t-keep-me-awake-at-nights.aspx#1650309</link><pubDate>Thu, 09 Oct 2008 13:06:44 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1650309</guid><dc:creator>Granville Barnett</dc:creator><description>&lt;p&gt;Its called: The C# Programming Language, Third Edition. Was released on October 10th according to Safari. Amazon (US) - &lt;a rel="nofollow" target="_new" href="http://www.amazon.com/Programming-Language-Microsoft-NET-Development/dp/0321562992"&gt;www.amazon.com/.../0321562992&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The good thing about this edition is that it has annotations in it like the framework design guidelines book. For the most part it seems the same as the other editions bar the new stuff and annotations.&lt;/p&gt;
&lt;p&gt;&amp;#39;Annotated C# 3.0 spec&amp;#39; - are we on about the same book here?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1650309" width="1" height="1"&gt;</description></item><item><title>re: Why boxing doesn't keep me awake at nights</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/10/08/why-boxing-doesn-t-keep-me-awake-at-nights.aspx#1650299</link><pubDate>Thu, 09 Oct 2008 12:27:41 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1650299</guid><dc:creator>skeet</dc:creator><description>&lt;p&gt;@Granville: Which book do you mean by &amp;quot;the updated Anders one&amp;quot;? I&amp;#39;m hoping to get hold of the Annotated C# 3.0 spec when it comes out, but I haven&amp;#39;t got it yet.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1650299" width="1" height="1"&gt;</description></item><item><title>re: Why boxing doesn't keep me awake at nights</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/10/08/why-boxing-doesn-t-keep-me-awake-at-nights.aspx#1650293</link><pubDate>Thu, 09 Oct 2008 11:58:19 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1650293</guid><dc:creator>Granville Barnett</dc:creator><description>&lt;p&gt;&amp;gt; I think there&amp;#39;s room for movement on both sides.&lt;/p&gt;
&lt;p&gt;Again, I agree. The problem here is that if you did take the advice of what an author said and it was hideously/slightly wrong and when prompted to explain why you did that you simply stated &amp;quot;Well, &amp;lt;INSERT AUTHOR&amp;gt; said that was the best way to go&amp;quot; The onus is surely on the reader to verify what they are reading is correct.&lt;/p&gt;
&lt;p&gt;One should always read several books on the same subject if only to gain a more rounded view of the topic in question. Reading one book and formulating an opinion based on one book is not really a valid opinion unless you have a vast amount of knowledge on one of the other subject areas it touches upon. &lt;/p&gt;
&lt;p&gt;I know that you have reviewed now several books on C# 3.0 (have you read the updated Anders one? Its pretty good, I find the annotations a nice touch) and I would suggest that your readers read as many of them as they can lay their hands on if only to gain that rounded perspective.&lt;/p&gt;
&lt;p&gt;&amp;gt; Obviously it&amp;#39;s nigh-on impossible to be perfect, but we can aim high :)&lt;/p&gt;
&lt;p&gt;Indeed.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1650293" width="1" height="1"&gt;</description></item><item><title>re: Why boxing doesn't keep me awake at nights</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/10/08/why-boxing-doesn-t-keep-me-awake-at-nights.aspx#1650286</link><pubDate>Thu, 09 Oct 2008 11:00:11 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1650286</guid><dc:creator>skeet</dc:creator><description>&lt;p&gt;I think there&amp;#39;s room for movement on both sides. Unfortunately in this case, there are plenty of books which *don&amp;#39;t* contradict each other but all overstate the importance of boxing when it comes to performance (without enough caveats about context, profiling, micro-optimisation etc).&lt;/p&gt;
&lt;p&gt;Readers should be alert and ready to check things which sound wrong - but there are quite a few things which don&amp;#39;t actually sound wrong but *are* wrong. (For instance, a writer describing some C# behaviour as if it matched Java when it didn&amp;#39;t - that would sound right to a reader familiar with Java, so they may readily believe it, even if reality is different.)&lt;/p&gt;
&lt;p&gt;In terms of efficiency, I think it makes a lot more sense for the author to get it right though - that&amp;#39;s only one person (or the author + tech reviewers) checking, rather than potentially thousands of readers. Obviously it&amp;#39;s nigh-on impossible to be perfect, but we can aim high :)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1650286" width="1" height="1"&gt;</description></item><item><title>re: Why boxing doesn't keep me awake at nights</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/10/08/why-boxing-doesn-t-keep-me-awake-at-nights.aspx#1650284</link><pubDate>Thu, 09 Oct 2008 10:49:42 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1650284</guid><dc:creator>Granville Barnett</dc:creator><description>&lt;p&gt;I totally agree that authors have a responsibility for being accurate, totally agree BUT maybe it is the reader who ought to change their stance then?&lt;/p&gt;
&lt;p&gt;Throughout I have always viewed books as merely an aid, I don&amp;#39;t take it word for word. I like to verify things myself (much like you have done here). I think the reason I take this stance, particularly with programming books is that many contradict one another. &lt;/p&gt;
&lt;p&gt;I&amp;#39;ve always felt that the burden is on the reader. Sure you can appreciate what someone else is telling you but its best to come to your own conclusions.&lt;/p&gt;
&lt;p&gt;That&amp;#39;s my two pence on the subject ;-)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1650284" width="1" height="1"&gt;</description></item><item><title>re: Why boxing doesn't keep me awake at nights</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/10/08/why-boxing-doesn-t-keep-me-awake-at-nights.aspx#1650278</link><pubDate>Thu, 09 Oct 2008 09:45:46 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1650278</guid><dc:creator>skeet</dc:creator><description>&lt;p&gt;Well, my post is aimed at a number of things - people searching for data, people interested in books and accuracy, and also as a place I can direct people if they start referring to books with examples of boxing as if they&amp;#39;re gospel truth.&lt;/p&gt;
&lt;p&gt;And yes, I&amp;#39;ll certainly be contacting Jeff before my review (which will be a while anyway). The errata sheet is going to be relatively bare though, if it keeps going in its current form...&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1650278" width="1" height="1"&gt;</description></item><item><title>re: Why boxing doesn't keep me awake at nights</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/10/08/why-boxing-doesn-t-keep-me-awake-at-nights.aspx#1650274</link><pubDate>Thu, 09 Oct 2008 09:28:23 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1650274</guid><dc:creator>Chris Nahr</dc:creator><description>&lt;p&gt;So your benchmarks were aimed at people who might find this page through Google when they are searching for &amp;quot;C# boxing performance&amp;quot; or the like? &amp;nbsp;That makes much more sense, I didn&amp;#39;t realize your intention here.&lt;/p&gt;
&lt;p&gt;Regardless of the general confusion about .NET performance issues, I still don&amp;#39;t think there&amp;#39;s any great danger of readers misunderstanding &amp;quot;CLR via C#&amp;quot; in particular, since it&amp;#39;s aimed at an advanced audience that would likely understand the context and intention of the example. &amp;nbsp;But perhaps Richter would agree to insert a disclaimer like the one you suggest in the next edition -- I presume you&amp;#39;ll contact him, as usual?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1650274" width="1" height="1"&gt;</description></item><item><title>re: Why boxing doesn't keep me awake at nights</title><link>http://msmvps.com/blogs/jon_skeet/archive/2008/10/08/why-boxing-doesn-t-keep-me-awake-at-nights.aspx#1650266</link><pubDate>Thu, 09 Oct 2008 08:12:25 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1650266</guid><dc:creator>skeet</dc:creator><description>&lt;p&gt;@Chris: You could certainly blame the reader for naivety, but I think there&amp;#39;s a duty for the author to pick examples which actually make their point accurately.&lt;/p&gt;
&lt;p&gt;Even if it&amp;#39;s easy to see what was meant, there can be little doubt that the book is *just plain wrong* when it claims that &amp;quot;The second version executes much faster.&amp;quot;&lt;/p&gt;
&lt;p&gt;Further, slips like this reinforce the micro-optimisation mentality which can be so damaging to readability. Suppose the book had made the point like this: &amp;quot;The first version boxes three times, which is wasteful - but probably irrelevant compared with the string formatting and console output. Be aware of performance, but keep a sense of context.&amp;quot; That would have been great! But no, instead a frankly alarmist tone was taken. I probably wouldn&amp;#39;t have gone to the trouble of benchmarking it if I hadn&amp;#39;t seen the same tone and attitude expressed in numerous forums. People really *don&amp;#39;t* take context into account nearly enough. If, by writing this blog post, just a handful of developers adopt a more contextual view of performance, I&amp;#39;ll be very happy. (Obviously I&amp;#39;ll never know, but there we go...)&lt;/p&gt;
&lt;p&gt;I agree that Jeff Richter is bound to be aware of the dominant factors here - so the question remains as to why he picked an example which didn&amp;#39;t actually demonstrate his point.&lt;/p&gt;
&lt;p&gt;I do want to stress how good the rest of the book is, btw. This is a relatively isolated incident *in this book* but it&amp;#39;s a symptom of a wider problem, and it happened to be a particularly simple claim to disprove. I started off just with the two options presented in the book - but then became interested in exactly where the rest of the time was going, hence the other options.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1650266" width="1" height="1"&gt;</description></item></channel></rss>