<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>OOP - There It Is - 3.0</title>
    <link>http://www.vpsw.com/blogbaby/</link>
    <description>A Very Practical Blog</description>
    <language>en-us</language>
    <copyright>Dean Fiala</copyright>
    <lastBuildDate>Wed, 11 Jun 2008 03:24:01 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.1.8102.813</generator>
    <managingEditor>dfiala@vpsw.com</managingEditor>
    <webMaster>dfiala@vpsw.com</webMaster>
    <item>
      <trackback:ping>http://www.vpsw.com/blogbaby/Trackback.aspx?guid=5ebf2926-8003-4c16-b328-8e91755317b0</trackback:ping>
      <pingback:server>http://www.vpsw.com/blogbaby/pingback.aspx</pingback:server>
      <pingback:target>http://www.vpsw.com/blogbaby/PermaLink,guid,5ebf2926-8003-4c16-b328-8e91755317b0.aspx</pingback:target>
      <dc:creator>Dean</dc:creator>
      <wfw:comment>http://www.vpsw.com/blogbaby/CommentView,guid,5ebf2926-8003-4c16-b328-8e91755317b0.aspx</wfw:comment>
      <wfw:commentRss>http://www.vpsw.com/blogbaby/SyndicationService.asmx/GetEntryCommentsRss?guid=5ebf2926-8003-4c16-b328-8e91755317b0</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
The Resharper cult members already know this, but for those who haven't joined yet,
version <a href="http://www.jetbrains.com/resharper/download/">4.0 released today</a> with
VS 2008 support -- huzzah,  huzzah.  No longer able to resist the chanting
and promises of eternal coolness I donned my robe and installed my free copy.
</p>
        <p>
I clearly should have joined sooner.  Resharper has already changed my life. 
First it pointed that I had redundant overrides  in the control I was working
on, which I had really meant to delete. 
</p>
        <p>
Then it reminded me about the new <a href="http://msdn.microsoft.com/en-us/library/bb384061.aspx">implicit
type declaration</a> keyword var, so this...
</p>
        <blockquote>
          <p>
            <font face="Courier New" color="#0000ff">XmlDocument SomeDoc = new XmlDocument();</font>
          </p>
        </blockquote>
        <p>
becomes...
</p>
        <blockquote>
          <p>
            <font face="Courier New" color="#0000ff">var SomeDoc = new XmlDocument();</font>
          </p>
        </blockquote>
        <p>
Granted, that's not too exciting, but if your type declaration is something like...
</p>
        <blockquote>
          <font face="Courier New" color="#0000ff">Dictionary&lt;SomeStrangeType,ANamespace.AnotherLongType&gt;
SomeDictionary = new Dictionary&lt;SomeStrangeType,ANamespace.AnotherLongType&gt;();</font>
        </blockquote>
        <p>
with var it becomes...
</p>
        <blockquote>
          <p>
            <font face="Courier New" color="#0000ff">var SomeDictionary = new Dictionary&lt;SomeStrangeType,ANamespace.AnotherLongType&gt;();</font>
          </p>
        </blockquote>
        <p>
Then Resharper pointed out something I didn't realize was available in C#, the <a href="http://msdn.microsoft.com/en-us/library/bb384062.aspx">object
intializer</a>?? VB.NET has long had something similar with the <a href="http://msdn.microsoft.com/en-us/library/wc500chb.aspx">With
statement</a> (now with <a href="http://msdn.microsoft.com/en-us/library/bb385125.aspx">object
initializer goodness</a> too).  What's nice about this is that it saves repeating
the instance name in front of the properties.  So this...
</p>
        <blockquote>
          <p>
            <font face="Courier New" color="#0000ff">var MenuBinding = new MenuItemBinding(); 
<br />
MenuBinding.DataMember = MenuItemElementName; 
<br />
MenuBinding.TextField = DisplayTextAttribute; 
<br />
MenuBinding.NavigateUrlField = NavigationUrlAttribute; 
<br />
MenuBinding.Depth = Depth;</font>
          </p>
        </blockquote>
        <p>
becomes...
</p>
        <blockquote>
          <p>
            <font face="Courier New" color="#0000ff">var MenuBinding = new MenuItemBinding 
<br />
  { 
<br />
     DataMember = MenuItemElementName, 
<br />
     TextField = DisplayTextAttribute, 
<br />
     NavigateUrlField = NavigationUrlAttribute, 
<br />
     Depth = Depth 
<br />
  };</font>
          </p>
        </blockquote>
        <p>
I was staring at this new construct when I realized that -- it shouldn't work. The
project I was working on was a Framework 2.0 project and these things were in 3.0
syntax.  But the darn thing compiles and works.  Not even a single warning. 
WTF?  It turns out that since 3.0 and 3.5 are based on 2.0, these are simply
compiler tricks -- there is nothing fundamentally different about the types. 
Here's a <a href="http://weblogs.asp.net/shahar/archive/2008/01/23/use-c-3-features-from-c-2-and-net-2-0-code.aspx">blog
post</a> that explores in more detail what is happening under the covers.
</p>
        <p>
Not bad for 15 minutes of tooling around.  Guess I am an official member. Where's
the Koolaid?
</p>
        <img width="0" height="0" src="http://www.vpsw.com/blogbaby/aggbug.ashx?id=5ebf2926-8003-4c16-b328-8e91755317b0" />
      </body>
      <title>Sharpening Knives</title>
      <guid isPermaLink="false">http://www.vpsw.com/blogbaby/PermaLink,guid,5ebf2926-8003-4c16-b328-8e91755317b0.aspx</guid>
      <link>http://www.vpsw.com/blogbaby/PermaLink,guid,5ebf2926-8003-4c16-b328-8e91755317b0.aspx</link>
      <pubDate>Wed, 11 Jun 2008 03:24:01 GMT</pubDate>
      <description>&lt;p&gt;
The Resharper cult members already know this, but for those who haven't joined yet,
version &lt;a href="http://www.jetbrains.com/resharper/download/"&gt;4.0 released today&lt;/a&gt; with
VS 2008 support -- huzzah,&amp;#160; huzzah.&amp;#160; No longer able to resist the chanting
and promises of eternal coolness I donned my robe and installed my free copy.
&lt;/p&gt;
&lt;p&gt;
I clearly should have joined sooner.&amp;#160; Resharper has already changed my life.&amp;#160;
First it pointed that I had redundant overrides&amp;#160; in the control I was working
on, which I had really meant to delete. 
&lt;/p&gt;
&lt;p&gt;
Then it reminded me about the new &lt;a href="http://msdn.microsoft.com/en-us/library/bb384061.aspx"&gt;implicit
type declaration&lt;/a&gt; keyword var, so this...
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
&lt;font face="Courier New" color="#0000ff"&gt;XmlDocument SomeDoc = new XmlDocument();&lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
becomes...
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
&lt;font face="Courier New" color="#0000ff"&gt;var SomeDoc = new XmlDocument();&lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
Granted, that's not too exciting, but if your type declaration is something like...
&lt;/p&gt;
&lt;blockquote&gt;&lt;font face="Courier New" color="#0000ff"&gt;Dictionary&amp;lt;SomeStrangeType,ANamespace.AnotherLongType&amp;gt;
SomeDictionary = new Dictionary&amp;lt;SomeStrangeType,ANamespace.AnotherLongType&amp;gt;();&lt;/font&gt; &lt;/blockquote&gt; 
&lt;p&gt;
with var it becomes...
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
&lt;font face="Courier New" color="#0000ff"&gt;var SomeDictionary = new Dictionary&amp;lt;SomeStrangeType,ANamespace.AnotherLongType&amp;gt;();&lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
Then Resharper pointed out something I didn't realize was available in C#, the &lt;a href="http://msdn.microsoft.com/en-us/library/bb384062.aspx"&gt;object
intializer&lt;/a&gt;?? VB.NET has long had something similar with the &lt;a href="http://msdn.microsoft.com/en-us/library/wc500chb.aspx"&gt;With
statement&lt;/a&gt; (now with &lt;a href="http://msdn.microsoft.com/en-us/library/bb385125.aspx"&gt;object
initializer goodness&lt;/a&gt; too).&amp;#160; What's nice about this is that it saves repeating
the instance name in front of the properties.&amp;#160; So this...
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
&lt;font face="Courier New" color="#0000ff"&gt;var MenuBinding = new MenuItemBinding(); 
&lt;br /&gt;
MenuBinding.DataMember = MenuItemElementName; 
&lt;br /&gt;
MenuBinding.TextField = DisplayTextAttribute; 
&lt;br /&gt;
MenuBinding.NavigateUrlField = NavigationUrlAttribute; 
&lt;br /&gt;
MenuBinding.Depth = Depth;&lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
becomes...
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
&lt;font face="Courier New" color="#0000ff"&gt;var MenuBinding = new MenuItemBinding 
&lt;br /&gt;
&amp;#160; { 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160; DataMember = MenuItemElementName, 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160; TextField = DisplayTextAttribute, 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160; NavigateUrlField = NavigationUrlAttribute, 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160;&amp;#160; Depth = Depth 
&lt;br /&gt;
&amp;#160; };&lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
I was staring at this new construct when I realized that -- it shouldn't work. The
project I was working on was a Framework 2.0 project and these things were in 3.0
syntax.&amp;#160; But the darn thing compiles and works.&amp;#160; Not even a single warning.&amp;#160;
WTF?&amp;#160; It turns out that since 3.0 and 3.5 are based on 2.0, these are simply
compiler tricks -- there is nothing fundamentally different about the types.&amp;#160;
Here's a &lt;a href="http://weblogs.asp.net/shahar/archive/2008/01/23/use-c-3-features-from-c-2-and-net-2-0-code.aspx"&gt;blog
post&lt;/a&gt; that explores in more detail what is happening under the covers.
&lt;/p&gt;
&lt;p&gt;
Not bad for 15 minutes of tooling around.&amp;#160; Guess I am an official member. Where's
the Koolaid?
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.vpsw.com/blogbaby/aggbug.ashx?id=5ebf2926-8003-4c16-b328-8e91755317b0" /&gt;</description>
      <comments>http://www.vpsw.com/blogbaby/CommentView,guid,5ebf2926-8003-4c16-b328-8e91755317b0.aspx</comments>
      <category>.NET</category>
      <category>2.0</category>
      <category>3.0</category>
      <category>3.5</category>
      <category>Resharper</category>
    </item>
    <item>
      <trackback:ping>http://www.vpsw.com/blogbaby/Trackback.aspx?guid=fd395a67-2ee8-4fe6-a0e6-08958e5ab80d</trackback:ping>
      <pingback:server>http://www.vpsw.com/blogbaby/pingback.aspx</pingback:server>
      <pingback:target>http://www.vpsw.com/blogbaby/PermaLink,guid,fd395a67-2ee8-4fe6-a0e6-08958e5ab80d.aspx</pingback:target>
      <dc:creator>Dean</dc:creator>
      <wfw:comment>http://www.vpsw.com/blogbaby/CommentView,guid,fd395a67-2ee8-4fe6-a0e6-08958e5ab80d.aspx</wfw:comment>
      <wfw:commentRss>http://www.vpsw.com/blogbaby/SyndicationService.asmx/GetEntryCommentsRss?guid=fd395a67-2ee8-4fe6-a0e6-08958e5ab80d</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">Spent Saturday getting my geek on at the
NOVA (Nothern Virigina to those of you outside of the greater Washington DC area) <a href="http://novacodecamp.org/">Code
Camp</a>.  The camp was pulled together by <a href="http://thequeue.net/blog/">Jeffrey
Schoolcraft</a> who marshalled a host of volunteers, speakers and contributors to
make it a great success.  If you didn't learn at least 10 things you probably
slept through all the sessions. Heck, I learned a bunch of things chatting between
sessions. Here's a smattering of what I learned.<br /><br /><ul><li>
It's time to start learning about <a href="http://msdn2.microsoft.com/en-us/netframework/aa663324.aspx">WCF
(Windows Communication Foundation).</a>  This is going to be the way to build
distributed applications going forward, and it seems to get away from some of the
headaches of remoting and web services.  Definitely a great plumbing platform
that should make it easier to develop apps that span systems.<br /></li><li>
 <a href="http://msdn2.microsoft.com/en-us/library/ms754130.aspx">WPF (Windows
Presentation Foundation)</a> is going to be very interesting eventually and even has <a href="http://www.hanselman.com/blog/NYTimesReaderWPFsFirstKillerApp.aspx">some
cool implementations</a>, but the design tools aren't ahem, mature yet. But WPF will
further erode the line between desktop and web apps. Fortunately, <a href="http://www.xaml.net/">XAML</a> should
be very familiar to anyone who has been doing ASP.NET development.<br /></li><li>
I really need to get a copy of <a href="http://www.jetbrains.com/resharper/">Resharper</a> for
my daily refactoring.</li><li>
There's a <a href="http://www.searchdotnet.com/default.aspx">better way</a> to search
for useful .NET information without having to wade through unrelated results in Google
or other search engines.  
<br /></li><li>
I was introduced to <a href="http://www.raboof.com/projects/Elmah/">ELMAH, the library
I need</a> to use to replace the hand-rolled exception code I've been lugging around.</li><li>
When ordering pizza for an event the ratio of pepperoni pizzas to cheese pizzas should
be between 2:1 and 3:1. Not enough people actually like cheese pizza to make 1:1 a
viable ratio.<br /></li></ul>
Also got to meet a lot of people I had only known by name or online.  Not a bad
way to spend a Saturday.<br /><p></p><img width="0" height="0" src="http://www.vpsw.com/blogbaby/aggbug.ashx?id=fd395a67-2ee8-4fe6-a0e6-08958e5ab80d" /></body>
      <title>Things I Learned At Camp</title>
      <guid isPermaLink="false">http://www.vpsw.com/blogbaby/PermaLink,guid,fd395a67-2ee8-4fe6-a0e6-08958e5ab80d.aspx</guid>
      <link>http://www.vpsw.com/blogbaby/PermaLink,guid,fd395a67-2ee8-4fe6-a0e6-08958e5ab80d.aspx</link>
      <pubDate>Mon, 16 Apr 2007 14:32:13 GMT</pubDate>
      <description>Spent Saturday getting my geek on at the NOVA (Nothern Virigina to those of you outside of the greater Washington DC area) &lt;a href="http://novacodecamp.org/"&gt;Code
Camp&lt;/a&gt;.&amp;nbsp; The camp was pulled together by &lt;a href="http://thequeue.net/blog/"&gt;Jeffrey
Schoolcraft&lt;/a&gt; who marshalled a host of volunteers, speakers and contributors to
make it a great success.&amp;nbsp; If you didn't learn at least 10 things you probably
slept through all the sessions. Heck, I learned a bunch of things chatting between
sessions. Here's a smattering of what I learned.&lt;br&gt;
&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;
It's time to start learning about &lt;a href="http://msdn2.microsoft.com/en-us/netframework/aa663324.aspx"&gt;WCF
(Windows Communication Foundation).&lt;/a&gt;&amp;nbsp; This is going to be the way to build
distributed applications going forward, and it seems to get away from some of the
headaches of remoting and web services.&amp;nbsp; Definitely a great plumbing platform
that should make it easier to develop apps that span systems.&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;
&amp;nbsp;&lt;a href="http://msdn2.microsoft.com/en-us/library/ms754130.aspx"&gt;WPF (Windows
Presentation Foundation)&lt;/a&gt; is going to be very interesting eventually and even has &lt;a href="http://www.hanselman.com/blog/NYTimesReaderWPFsFirstKillerApp.aspx"&gt;some
cool implementations&lt;/a&gt;, but the design tools aren't ahem, mature yet. But WPF will
further erode the line between desktop and web apps. Fortunately, &lt;a href="http://www.xaml.net/"&gt;XAML&lt;/a&gt; should
be very familiar to anyone who has been doing ASP.NET development.&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;
I really need to get a copy of &lt;a href="http://www.jetbrains.com/resharper/"&gt;Resharper&lt;/a&gt; for
my daily refactoring.&lt;/li&gt;
&lt;li&gt;
There's a &lt;a href="http://www.searchdotnet.com/default.aspx"&gt;better way&lt;/a&gt; to search
for useful .NET information without having to wade through unrelated results in Google
or other search engines.&amp;nbsp; 
&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;
I was introduced to &lt;a href="http://www.raboof.com/projects/Elmah/"&gt;ELMAH, the library
I need&lt;/a&gt; to use to replace the hand-rolled exception code I've been lugging around.&lt;/li&gt;
&lt;li&gt;
When ordering pizza for an event the ratio of pepperoni pizzas to cheese pizzas should
be between 2:1 and 3:1. Not enough people actually like cheese pizza to make 1:1 a
viable ratio.&lt;br&gt;
&lt;/li&gt;
&lt;/ul&gt;
Also got to meet a lot of people I had only known by name or online.&amp;nbsp; Not a bad
way to spend a Saturday.&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.vpsw.com/blogbaby/aggbug.ashx?id=fd395a67-2ee8-4fe6-a0e6-08958e5ab80d" /&gt;</description>
      <comments>http://www.vpsw.com/blogbaby/CommentView,guid,fd395a67-2ee8-4fe6-a0e6-08958e5ab80d.aspx</comments>
      <category>.NET</category>
      <category>3.0</category>
    </item>
  </channel>
</rss>