<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.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>I Love that New Syntax Smell : musings</title><link>http://blogs.msdn.com/arich/archive/tags/musings/default.aspx</link><description>Tags: musings</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Corrections, explanations, etc.</title><link>http://blogs.msdn.com/arich/archive/2003/11/25/56823.aspx</link><pubDate>Wed, 26 Nov 2003 00:32:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:56823</guid><dc:creator>arich</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/arich/comments/56823.aspx</comments><wfw:commentRss>http://blogs.msdn.com/arich/commentrss.aspx?PostID=56823</wfw:commentRss><description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;
    &lt;p&gt;
        First, I should apologize for the lack of postings lately.&amp;#160; A combination of
        server downtime/outages and apathy have kept me from making postings.&amp;#160; Now that
        we're back up, I think I should clarify some of what I've said.
    &lt;/p&gt;
    &lt;p&gt;
        &lt;strong&gt;Value types&lt;/strong&gt; aren't as grand as I make them out to be.&amp;#160; They're
        designed by the CLR to be very lightweight, stack-based, blittable items.&amp;#160; Nothing
        fancy.&amp;#160; You can't define a default constructor for them.&amp;#160; For Whidbey, we
        were attempting to&amp;#160;extend the&amp;#160;functionality and usefulness of&amp;#160;value
        types, but the design team has determined that we shouldn't (for a variety of reasons).&amp;#160;
        Really, in most cases, you're going to want a ref type.&amp;#160; The value type incurs
        extra cost if you want to put it on the gc heap (something I may address later, called &lt;em&gt;boxing&lt;/em&gt;).&amp;#160;
        The value type is simply the CLR exposing for users the same type that it uses internally
        for the fundamental types - ints, floats, etc.&amp;#160; Users should try to hold true
        to this concept.&amp;#160; So, the instances where a value type are appropriate are actually
        fewer than I originally stated.
    &lt;/p&gt;
    &lt;p&gt;
        &lt;strong&gt;My stack example&lt;/strong&gt; isn't as nice as it ought to be.&amp;#160; I thought
        it would well demonstrate what my concept of value types vs. ref types is, but, the
        more I look at it, the more I believe I should have made the Node a ref type.&amp;#160;
        (Largely in part to a redefinition of my thinking on value types, as explained above.)&amp;#160;
        But, I'll leave it up as it is for now.
    &lt;/p&gt;
    &lt;p&gt;
        Someone made a request for &lt;strong&gt;explanations &lt;/strong&gt;of the sources that I'm posting.&amp;#160;
        In the future, I'll make an effort to explain what I'm up to in my code.&amp;#160; Another
        example should be forthcoming.
    &lt;/p&gt;
    &lt;p&gt;
        Also, if you have any suggestions for what I should try to tackle, post comments or
        suggestions, or shoot me an email at &lt;a href="mailto:arich@microsoft.com"&gt;arich@microsoft.com&lt;/a&gt;.
    &lt;/p&gt;
&lt;/body&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=56823" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/arich/archive/tags/musings/default.aspx">musings</category></item><item><title>Context-sensitive keywords</title><link>http://blogs.msdn.com/arich/archive/2003/11/07/56814.aspx</link><pubDate>Fri, 07 Nov 2003 20:29:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:56814</guid><dc:creator>arich</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/arich/comments/56814.aspx</comments><wfw:commentRss>http://blogs.msdn.com/arich/commentrss.aspx?PostID=56814</wfw:commentRss><description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;
    &lt;p&gt;
        If you've used Managed Extensions, you're familiar with the CLR&amp;#160;types that &lt;strong&gt;&lt;font face="Courier"&gt;__gc&lt;/font&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;font face="Courier"&gt;__value&lt;/font&gt;&lt;/strong&gt; exposed.&amp;#160;
        These have now been replaced with the context-sensitive keywords &lt;font face="Courier"&gt;&lt;strong&gt;ref&lt;/strong&gt;&lt;/font&gt; and &lt;strong&gt;&lt;font face="Courier"&gt;value&lt;/font&gt;&lt;/strong&gt;. 
    &lt;/p&gt;
    &lt;p&gt;
        &lt;strong&gt;Context-sensitive keywords?&lt;/strong&gt;&amp;#160; That's right.&amp;#160; We've made
        huge efforts (especially with respect to &lt;a href="http://blogs.gotdotnet.com/branbray/PermaLink.aspx/1dd3fbd7-72e1-4490-9419-e6d62fc3536b"&gt;IJW&lt;/a&gt; work)
        to ensure that we don't break our users' code in our haste to add new features.&amp;#160;
        That's why most of the CLR features exposed by Whidbey will only be keywords &lt;em&gt;in
        the right context&lt;/em&gt;.&amp;#160; So, if you've already got an identifier named &lt;font face="Courier"&gt;&lt;strong&gt;value&lt;/strong&gt;&lt;/font&gt; -&amp;#160;and
        who doesn't - don't worry.&amp;#160; Compiling with /clr isn't going to break that. 
    &lt;/p&gt;
    &lt;p&gt;
        You can still create classes just like you always have.&amp;#160; With the added CLR types,
        most of us refer to conventional C++ classes as "native types."&amp;#160; We expose the
        new CLR types as&amp;#160;extensions of regular classes.&amp;#160; Where you might have &lt;strong&gt;&lt;font face="Courier"&gt;class
        A{};&lt;/font&gt;&lt;/strong&gt; before, you now have &lt;strong&gt;&lt;font face="Courier"&gt;ref class A{};&lt;/font&gt;&lt;/strong&gt;.
        Now you're dealing with a CLR type, and all the benefits that provides, &lt;em&gt;all without
        breaking exisiting code&lt;/em&gt;. 
    &lt;/p&gt;
    &lt;p&gt;
        This is really at the heart of what sets this new implementation apart from Managed
        Extensions.&amp;#160; It has an integrated feel into the original language, without breaking
        existing code, and __without __all __those __ugly __double __underscores.&amp;#160; The
        code looks and feels natural.&amp;#160; 
    &lt;/p&gt;
&lt;/body&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=56814" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/arich/archive/tags/musings/default.aspx">musings</category></item><item><title>That crazy GC Heap</title><link>http://blogs.msdn.com/arich/archive/2003/11/06/56813.aspx</link><pubDate>Fri, 07 Nov 2003 04:36:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:56813</guid><dc:creator>arich</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/arich/comments/56813.aspx</comments><wfw:commentRss>http://blogs.msdn.com/arich/commentrss.aspx?PostID=56813</wfw:commentRss><description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;
    &lt;p&gt;
        If you're like me, the whole idea of a garbage collected heap seems, at first, contrarian
        to the C++ coder's mentality.&amp;#160; As a breed, we'd prefer to handle memory (de-)allocations
        completely on our own.&amp;#160; But if you're like me, and you've spent hours trying
        to figure out where that memory hole is coming from, then maybe the idea of a GC has
        looked good, from time to time.
    &lt;/p&gt;
    &lt;p&gt;
        Coding can take on a slightly different feel when you're working with a GC.&amp;#160;
        You may feel a little sloppy, at first.&amp;#160; C++ programmers have been&amp;#160;conditioned&amp;#160;to
        cover all their bases, watch their backs, and in general be as careful as they possibly
        can be.&amp;#160; Coding with a GC frees you from some of these constraints, so it can
        feel a little "loosey-goosey" at first.
    &lt;/p&gt;
    &lt;p&gt;
        But in my opinion, having a GC is mighty nice.&amp;#160; It's like visiting a hotel.&amp;#160;
        Don't make the bed, don't scrub the toilet; that's what the cleaning staff is for.&amp;#160;
        Just enjoy the nice, clean room.&amp;#160; Having a GC do the dirty work for you frees
        you up to concentrate on more important details.
    &lt;/p&gt;
&lt;/body&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=56813" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/arich/archive/tags/musings/default.aspx">musings</category></item></channel></rss>