<?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>Peter Ritchie's MVP Blog : Pontification</title><link>http://msmvps.com/blogs/peterritchie/archive/tags/Pontification/default.aspx</link><description>Tags: Pontification</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>Pontificating Virtual Parameterized Constructors in C#</title><link>http://msmvps.com/blogs/peterritchie/archive/2008/11/18/pontificating-virtual-parameterized-constructors-in-c.aspx</link><pubDate>Tue, 18 Nov 2008 17:55:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1654469</guid><dc:creator>PeterRitchie</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/peterritchie/rsscomments.aspx?PostID=1654469</wfw:commentRss><comments>http://msmvps.com/blogs/peterritchie/archive/2008/11/18/pontificating-virtual-parameterized-constructors-in-c.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://blogs.msdn.com/tomholl/archive/2008/11/18/constructors-and-inheritance-why-is-this-still-so-painful.aspx"&gt;Tom Hollander recently posted&lt;/a&gt; about a change he required to the Enterprise Library for date/time validation.&amp;nbsp; He had to create a new class (rather than modify the Enterprise Library) that derived from another, defective class.&amp;nbsp; One of his complaints was that in order to effectively implement the base class he had to also write matching constructors that simply called the base class.&amp;nbsp; His suggestion was effectively to add the concept of virtual parameterized constructors to C#.&amp;nbsp; I detail &amp;ldquo;parameterized constructors&amp;rdquo; because C# already effectively has virtual default constructors.&amp;nbsp; In the following example the base constructor (Form()) is automatically called by the derivative:&lt;/p&gt;
&lt;div style="font-size:10pt;background:white;color:black;font-family:courier new;"&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;MyForm&lt;/span&gt; : &lt;span style="color:#2b91af;"&gt;Form&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; MyForm()&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Virtual parameterized constructors are not new, and from a mere language standpoint this seems reasonable.&amp;nbsp; Pragmatically though, I believe, this is another story.&amp;nbsp; It seems logical to be able to simply inherit the parameterized constructors of the base class; but, there are so many times that this isn&amp;#39;t the case or some generally accepted principles that would be contravened by a language addition like this. &lt;/p&gt;
&lt;p&gt;Let&amp;#39;s first look at the &lt;a href="http://en.wikipedia.org/wiki/Open/closed_principle"&gt;open/closed principle&lt;/a&gt; (OCP).&amp;nbsp; The OCP suggests classes should be open for extension but closed for modification.&amp;nbsp; Robert Martin suggests [1] properly designed class hierarchies that obey OCP implement an abstraction; i.e. derive from an abstract class or implement an interface.&amp;nbsp; For example: &lt;/p&gt;
&lt;div style="font-size:10pt;background:white;color:black;font-family:courier new;"&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;interface&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;IShape&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;{&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; Draw(&lt;span style="color:#2b91af;"&gt;Graphics&lt;/span&gt; graphics);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;}&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Rectangle&lt;/span&gt; : &lt;span style="color:#2b91af;"&gt;IShape&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;{&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#008000;"&gt;//...&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; Draw(&lt;span style="color:#2b91af;"&gt;Graphics&lt;/span&gt; graphics)&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#808080;"&gt;///&lt;/span&gt;&lt;span style="color:#008000;"&gt;...&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Second, let&amp;#39;s look at the &amp;quot;&lt;a href="http://www.ubookcase.com/book/Addison.Wesley/CPP.Coding.Standards.101.Rules.Guidelines.and.Best.Practices/0321113586/ch34lev1sec2.html"&gt;prefer composition over inheritance&lt;/a&gt;&amp;quot; principle.&amp;nbsp; The effect of a language change like this on a design that prefers composition should be fairly obvious.&amp;nbsp; Here&amp;#39;s an example of this principle: &lt;/p&gt;
&lt;div style="font-size:10pt;background:white;color:black;font-family:courier new;"&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;interface&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;IPolygon&lt;/span&gt; {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; Draw(&lt;span style="color:#2b91af;"&gt;Graphics&lt;/span&gt; graphics);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;}&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;sealed&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Polygon&lt;/span&gt; {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000ff;"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;readonly&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Point&lt;/span&gt;[] points;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; Polygon(&lt;span style="color:#2b91af;"&gt;Point&lt;/span&gt;[] points) {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.points = points;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; Draw(&lt;span style="color:#2b91af;"&gt;Graphics&lt;/span&gt; graphics) {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000ff;"&gt;for&lt;/span&gt;(&lt;span style="color:#0000ff;"&gt;int&lt;/span&gt; i = 1; i &amp;lt; points.Length; i++) {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graphics.DrawLine(&lt;span style="color:#2b91af;"&gt;Pens&lt;/span&gt;.Black, points[i-1], points);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;}&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Rectangle&lt;/span&gt; : &lt;span style="color:#2b91af;"&gt;IPolygon&lt;/span&gt; {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000ff;"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;readonly&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Polygon&lt;/span&gt; polygon;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; Rectangle(&lt;span style="color:#2b91af;"&gt;Point&lt;/span&gt; location, &lt;span style="color:#2b91af;"&gt;Size&lt;/span&gt; size) {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#2b91af;"&gt;Point&lt;/span&gt;[] points = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Point&lt;/span&gt;[5];&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; points[4] = points[0] = location;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; points[1] = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Point&lt;/span&gt;(location.X + size.Width, location.Y);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; points[2] = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Point&lt;/span&gt;(location.X + size.Width, location.Y + size.Height);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; points[3] = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Point&lt;/span&gt;(location.X, location.Y + size.Height);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; polygon = &lt;span style="color:#0000ff;"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;Polygon&lt;/span&gt;(points);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; Draw(&lt;span style="color:#2b91af;"&gt;Graphics&lt;/span&gt; graphics) {&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; polygon.Draw(graphics);&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin:0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Obviously there is no way to use virtual parameterized constructors here.&lt;/p&gt;
&lt;p&gt;Clearly, designs that take into account OCP and prefer-composition-over-inheritance would not benefit from a &amp;quot;virtual parameterized constructor&amp;quot; language addition. &lt;/p&gt;
&lt;p&gt;Finally, let&amp;#39;s look at why a class might have many constructors causing such friction for derivatives.&amp;nbsp; There&amp;#39;s many reasons why a class might have many constructors.&amp;nbsp; I believe all are indications of a poorly designed class.&amp;nbsp; My first thought would be that many constructors is a result of a large class and that the large-class-code-smell should be an indication for redesign.&amp;nbsp; A large class could be in an indication of a motherclass; but in either case this is likely a single responsibility principle (SRP) violation and the class is doing much more than it should and be redesigned.&amp;nbsp; If the class isn&amp;#39;t large but has many constructors, this was likely done not in response to how the class should/would be used but to cover every possible way of constructing the type.&amp;nbsp; This would then be a &lt;a href="http://en.wikipedia.org/wiki/You_Ain&amp;#39;t_Gonna_Need_It"&gt;YAGNI&lt;/a&gt; violation and the number of constructors should simply be pared down. &lt;/p&gt;
&lt;p&gt;But, what about when you have to deal with poorly design hierarchies and don&amp;#39;t have the ability to modify them?&amp;nbsp; A valid point; but, simply for the lack of friction of writing pass-through constructors I don&amp;#39;t think adding to the language to support poorly designed classes is a good for the language or its developers. &lt;/p&gt;
&lt;p&gt;While an addition like virtual parameterized constructors seems benign, its limited actual usefulness makes the effort not worth the reward.&amp;nbsp; Plus, it introduces greater abilities to create poorly designed types. &lt;/p&gt;
&lt;p&gt;[1] &lt;a href="http://www.objectmentor.com/resources/articles/ocp.pdf"&gt;http://www.objectmentor.com/resources/articles/ocp.pdf&lt;/a&gt; &lt;/p&gt;
&lt;div style="text-align:left;margin:0px;padding:4px 4px 4px 4px;" class="wlWriterHeaderFooter"&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http://msmvps.com/blogs/peterritchie/archive/2008/11/18/pontificating-virtual-parameterized-constructors-in-c.aspx&amp;amp;title=Pontificating%20Virtual%20Parameterized%20Constructors%20in%20C"&gt;&lt;img border="0" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://msmvps.com/blogs/peterritchie/archive/2008/11/18/pontificating-virtual-parameterized-constructors-in-c.aspx&amp;amp;bgcolor=0080C0&amp;amp;fgcolor=FFFFFF&amp;amp;border=000000&amp;amp;cbgcolor=D4E1ED&amp;amp;cfgcolor=000000" alt="DotNetKicks Image" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1654469" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/peterritchie/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://msmvps.com/blogs/peterritchie/archive/tags/Software+Development/default.aspx">Software Development</category><category domain="http://msmvps.com/blogs/peterritchie/archive/tags/Pontification/default.aspx">Pontification</category><category domain="http://msmvps.com/blogs/peterritchie/archive/tags/Patterns/default.aspx">Patterns</category><category domain="http://msmvps.com/blogs/peterritchie/archive/tags/OOD/default.aspx">OOD</category><category domain="http://msmvps.com/blogs/peterritchie/archive/tags/AntiPattern/default.aspx">AntiPattern</category></item><item><title>Location of unit tests.</title><link>http://msmvps.com/blogs/peterritchie/archive/2008/08/20/location-of-unit-tests.aspx</link><pubDate>Thu, 21 Aug 2008 01:24:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1645299</guid><dc:creator>PeterRitchie</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/peterritchie/rsscomments.aspx?PostID=1645299</wfw:commentRss><comments>http://msmvps.com/blogs/peterritchie/archive/2008/08/20/location-of-unit-tests.aspx#comments</comments><description>&lt;p&gt;&lt;br /&gt;I had a short&amp;nbsp; conversation at Alt.Net Canada about the location of unit tests.&amp;nbsp; I personally tend towards a distinct unit test project.&amp;nbsp; But, I deal with mostly commercial, off-the-shelf (COTS) projects where I simply can&amp;#39;t ship code like that.&amp;nbsp; I also don&amp;#39;t want to wire-off the unit test via #if because I would then be shipping something different than that which was tested. &lt;/p&gt;
&lt;p&gt;From an enterprise application point of view, this is different.&amp;nbsp; I would have no problem including the unit tests within their respective project as production code &lt;/p&gt;
&lt;div style="text-align:left;margin:0px;padding:4px 4px 4px 4px;" class="wlWriterHeaderFooter"&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http://msmvps.com/blogs/peterritchie/archive/2008/08/20/location-of-unit-tests.aspx"&gt;&lt;img border="0" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://msmvps.com/blogs/peterritchie/archive/2008/08/20/location-of-unit-tests.aspx&amp;amp;bgcolor=0080C0&amp;amp;fgcolor=FFFFFF&amp;amp;border=000000&amp;amp;cbgcolor=D4E1ED&amp;amp;cfgcolor=000000" alt="DotNetKicks Image" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1645299" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/peterritchie/archive/tags/General/default.aspx">General</category><category domain="http://msmvps.com/blogs/peterritchie/archive/tags/.NET+Development/default.aspx">.NET Development</category><category domain="http://msmvps.com/blogs/peterritchie/archive/tags/Design_2F00_Coding+Guidance/default.aspx">Design/Coding Guidance</category><category domain="http://msmvps.com/blogs/peterritchie/archive/tags/Pontification/default.aspx">Pontification</category><category domain="http://msmvps.com/blogs/peterritchie/archive/tags/TDD/default.aspx">TDD</category></item><item><title>My Wishlist for C# 4</title><link>http://msmvps.com/blogs/peterritchie/archive/2008/02/12/my-wishlist-for-c-4.aspx</link><pubDate>Tue, 12 Feb 2008 16:57:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1510374</guid><dc:creator>PeterRitchie</dc:creator><slash:comments>10</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/peterritchie/rsscomments.aspx?PostID=1510374</wfw:commentRss><comments>http://msmvps.com/blogs/peterritchie/archive/2008/02/12/my-wishlist-for-c-4.aspx#comments</comments><description>&lt;p&gt;[Edit: fixed the not-ready-for-publication problems]&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There seems to be more than few people blogging about what they hope C# 4 will do for them.&amp;nbsp; I haven&amp;#39;t seen one that really synchronizes with my thoughts, so I&amp;#39;d thought I&amp;#39;d post my own list.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Variance&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A good story with regard to variance with generics is vital for upcoming versions of C# 4.&amp;nbsp; You could argue that this should have been done in 3, but, unfortunately, that wasn&amp;#39;t the focus.&amp;nbsp; I think this really needs to be done for 4; and if &lt;a class="" href="http://blogs.msdn.com/ericlippert/archive/tags/Covariance+and+Contravariance/default.aspx"&gt;Eric Lippert&amp;#39;s blog&lt;/a&gt; is any indication, that may come true.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Design By Contract&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Design by Contract (DbC) means programmers can define verifiable interfaces.&amp;nbsp; This explicit intention information is then used by the compiler to greatly increase the compile-time checking it can do.&amp;nbsp; In most cases this means no checking need be done at run-time because the compiler has verified the that condition cannot occur at run-time, increasing reliability and improving performance.&amp;nbsp; There&amp;#39;s hint of this in the framework already with the internal classes &lt;font face="courier new,courier"&gt;ImmutableAttribute&lt;/font&gt; and &lt;font face="courier new,courier"&gt;InvariantMethodAttribute&lt;/font&gt;.&amp;nbsp; First-class language support for DbC would go a long way to being able to write more reliable software.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Concurrency&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Various leaders in the industry (Microsoft included) are recognizing the processor speed improvements will essentially stop being vertical and continue to be horizontal (i.e. instead of increases in processor speed, increases in processors or cores will be the norm).&amp;nbsp; This means that in order for applications to utilize that type of system processing throughput concurrency will become more mainstream.&amp;nbsp; Microsoft has various concurrency initiatives going on (like the Parallel Framework Extensions).&amp;nbsp; It&amp;#39;s only logical that lessons learned from this project not long will make their way into the BCL and the .NET Framework but also into the respective languages (C# included, I hope).&amp;nbsp; In this respect I hope that concurrency issues become first-class citizens in the library.&amp;nbsp; This would include things like immutability.&amp;nbsp; In the spirit of Agile development, the sooner this gets into the language the sooner it can be embraced and evolve.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Object-Oriented Programming&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Much like &lt;a class="" href="http://msmvps.com/blogs/jon.skeet/archive/2008/02/10/c-4-part-4-my-manifesto-and-wishlist.aspx?CommentPosted=true#commentmessage"&gt;Jon Skeet&lt;/a&gt;, I believe the language designers should recognize that C# is an object-oriented language first and foremost.&amp;nbsp; This fact should continue to focus what, if any, aspects of other programming paradigms are added to the language. Paradigms like Aspect-Oriented Programming, Functional Programming, etc.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;infoof, memberof, propertyof, eventof, methodof Operators&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The information these operators require is so easy for the compiler to simply dump in the IL stream.&amp;nbsp; For users to do the same thing requires that they have a string containing the name of the member in question--which can&amp;#39;t be checked at compile time and leads to maintenance nightmares.&amp;nbsp; Imagine what life would be like without the typeof operator forcing use to use code like this:&lt;/p&gt;
&lt;div style="FONT-SIZE:10pt;BACKGROUND:white;COLOR:black;FONT-FAMILY:Courier New;"&gt;
&lt;p style="MARGIN:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR:#2b91af;"&gt;Type&lt;/span&gt; type = &lt;span style="COLOR:#2b91af;"&gt;Type&lt;/span&gt;.GetType(&lt;span style="COLOR:#a31515;"&gt;&amp;quot;MyNamespace.MyClass&amp;quot;&lt;/span&gt;);&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;Instead of:&lt;/p&gt;
&lt;div style="FONT-SIZE:10pt;BACKGROUND:white;COLOR:black;FONT-FAMILY:Courier New;"&gt;
&lt;p style="MARGIN:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR:#2b91af;"&gt;Type&lt;/span&gt; type = &lt;span style="COLOR:blue;"&gt;typeof&lt;/span&gt;(&lt;span style="COLOR:#2b91af;"&gt;MyNamespace.MyClass&lt;/span&gt;);&lt;/p&gt;&lt;/div&gt;
&lt;p&gt;...if I rename &lt;font face="courier new,courier"&gt;MyClass&lt;/font&gt; to &lt;font face="courier new,courier"&gt;UsefulClass&lt;/font&gt; no refactorying tool I&amp;#39;ve see will modify the &lt;font face="courier new,courier"&gt;&amp;quot;MyNamespace.MyClass&amp;quot;&lt;/font&gt; string and compilation will succeed and lead to a runtime-error.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cleanup Some Long-standing Issues&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;The above and variance could be viewed as a long-standing issues; but, I think&amp;nbsp;they deserves to be called-out on they&amp;#39;re own,&amp;nbsp;they would be huge improvements.&amp;nbsp; Detection of recursive properties, for example.&amp;nbsp; The C# team have a backlog of a few things like this; now&amp;#39;s the time.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Extensible Compiler&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Years back my original idea for this was to have an IDE that automatically corrects mistakes.&amp;nbsp; e.g. if an &amp;quot;; expected&amp;quot; error was spit out, the IDE could intercept it, correct the code, and recompile.&amp;nbsp; But, this extensibility idea can be so much more than that.&amp;nbsp; This sort of extensibility could introduce Aspect-Oriented Programming fundamentals or Domain-Specific Language abilities without the language really understanding the concepts at all.&amp;nbsp; This extensibility would be very powerful for programmers and would give them the ability to evolve their language without being tied to the release schedule of the C# team.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Thinking Out Loud&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Class-scoped aliases: Aliases in C# are a bit of a pariah, they&amp;#39;re at global, file scope; making them not all that useful.&amp;nbsp; In C++, for example, it&amp;#39;s quite common to declare type aliases within a class declaration (usually based on a templated type).&amp;nbsp; It would be nice to be able to create&amp;nbsp;an instance of a type based on an alias within a class.&amp;nbsp; E.g. &lt;font face="courier new,courier"&gt;MyType.MyAlias o = new MyType.MyAlias;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fmsmvps.com%2fblogs%2fpeterritchie%2farchive%2f2008%2f02%2f06%2funit-testing-the-units.aspx"&gt;&lt;img alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fmsmvps.com%2fblogs%2fpeterritchie%2farchive%2f2008%2f02%2f06%2funit-testing-the-units.aspx" border="0" /&gt;&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1510374" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/peterritchie/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://msmvps.com/blogs/peterritchie/archive/tags/Pontification/default.aspx">Pontification</category><category domain="http://msmvps.com/blogs/peterritchie/archive/tags/C_2300_+4/default.aspx">C# 4</category></item><item><title>Is C++/CLI a Second Class Language with Microsoft?</title><link>http://msmvps.com/blogs/peterritchie/archive/2008/01/29/is-c-cli-a-second-class-language-with-microsoft.aspx</link><pubDate>Tue, 29 Jan 2008 16:03:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1485713</guid><dc:creator>PeterRitchie</dc:creator><slash:comments>9</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/peterritchie/rsscomments.aspx?PostID=1485713</wfw:commentRss><comments>http://msmvps.com/blogs/peterritchie/archive/2008/01/29/is-c-cli-a-second-class-language-with-microsoft.aspx#comments</comments><description>&lt;p&gt;The post frequency on the &lt;a class="" href="http://blogs.msdn.com/vcblog/"&gt;Visual C++ team blog&lt;/a&gt; is reasonably high.&amp;nbsp;Some posts deal with new features that were added to VC++ 2008.&lt;/p&gt;
&lt;p&gt;But, is Visual C++ a second-class citizen in the Visual Studio product group?&amp;nbsp; Recently the &lt;a class="" href="http://blogs.msdn.com/robcaron/archive/2008/01/27/7278319.aspx"&gt;Visual Studio 2008 Product Comparison&lt;/a&gt; was released (don&amp;#39;t ask me why it wasn&amp;#39;t released at the same time as the products...).&amp;nbsp; In the product comparisons VC++ Express has an inordinate&amp;nbsp;number of features that only it doesn&amp;#39;t have.&amp;nbsp; When you look at the Visual C++ 2008 Express Edition &lt;a class="" href="http://www.microsoft.com/express/product/default.aspx"&gt;product&lt;/a&gt; &lt;a class="" href="http://www.microsoft.com/express/vc/"&gt;sites&lt;/a&gt;, it seems pretty clear that it&amp;#39;s geared towards native-only software development.&amp;nbsp; Despite this the product comparison shows VC++ Express has Managed Debugging, Mixed-Mode Debugging and&amp;nbsp;Compiler Support for any CPU (which details &amp;quot;...compile your managed application...&amp;quot;).&amp;nbsp; But, VC++ 2008 Express is the only edition that doesn&amp;#39;t support adding reference to WCF services (&amp;quot;Service Reference&amp;quot;), Code Snipped Manager, Code Snippets, Rename Refactoring, Text File (you can&amp;#39;t create a plain text file with VC++ 2008 Express?), and one of two editions&amp;nbsp;that doesn&amp;#39;t include support for XML File (create a blank XML file), and SQL Server 2005 Compact Edition.&amp;nbsp; As well, only VC++ 2008 doesn&amp;#39;t include managed-only features like&amp;nbsp;Object Browser, Object Relational Designer, and SQLMetal (the last two deal with .NET-only LINQ-to-SQL.&lt;/p&gt;
&lt;p&gt;C++ has stagnated as a language for quite some time, but Visual C++ 2008 includes new language features like C++0x and TR1 that help evolve the language for the parallel future.&amp;nbsp; But, despite assurances that &lt;a class="" href="http://channel9.msdn.com/ShowPost.aspx?PostID=281987"&gt;native development is still a focus&lt;/a&gt; at Microsoft, there is the appearance that VC++ just isn&amp;#39;t getting the same resources as the other editions.&amp;nbsp; Makes you wonder how much longer will Microsoft keep it in the Visual Studio family...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1485713" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/peterritchie/archive/tags/Software+Development/default.aspx">Software Development</category><category domain="http://msmvps.com/blogs/peterritchie/archive/tags/C_2B002B002F00_CLI/default.aspx">C++/CLI</category><category domain="http://msmvps.com/blogs/peterritchie/archive/tags/Pontification/default.aspx">Pontification</category><category domain="http://msmvps.com/blogs/peterritchie/archive/tags/Visual+Studio+2008/default.aspx">Visual Studio 2008</category></item><item><title>Unified Field Theory, is it Possible?</title><link>http://msmvps.com/blogs/peterritchie/archive/2007/04/08/unified-field-theory-is-it-possible.aspx</link><pubDate>Sun, 08 Apr 2007 15:21:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:769704</guid><dc:creator>PeterRitchie</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/peterritchie/rsscomments.aspx?PostID=769704</wfw:commentRss><comments>http://msmvps.com/blogs/peterritchie/archive/2007/04/08/unified-field-theory-is-it-possible.aspx#comments</comments><description>&lt;P&gt;Is &lt;A class="" href="http://en.wikipedia.org/wiki/Grand_unified_field_theory"&gt;Unified Field Theory&lt;/A&gt; possible?&amp;nbsp; It sounds like it's more than elusive..&lt;/P&gt;
&lt;P&gt;I was reading about some interesting theories that our reality may simply be a perception of several different realities.&amp;nbsp; Not entirely ground breaking; but, my take on it is that if our perception of these multiple realities is a side-effect of the interaction of these realities and that each reality may not follow the same rules as the other realities, can a "unified field theory" of &lt;STRONG&gt;our&lt;/STRONG&gt; perception be possible?&lt;/P&gt;
&lt;P&gt;This may have some interesting effects in that it may affect how Moore's Law can continue through discovery of new architectures.&amp;nbsp; In computer science,&amp;nbsp;this will likely affect how software is written.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=769704" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/peterritchie/archive/tags/Software+Development/default.aspx">Software Development</category><category domain="http://msmvps.com/blogs/peterritchie/archive/tags/Pontification/default.aspx">Pontification</category></item></channel></rss>