<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="http://code.msdn.microsoft.com/rss.xsl"?><rss version="2.0"><channel><title>vslangfutures Forum Rss Feed</title><link>http://code.msdn.microsoft.com/vslangfutures/Thread/List.aspx</link><description>vslangfutures Forum Rss Description</description><item><title>NEW POST: Future Focus: Document Map Margin </title><link>http://code.msdn.microsoft.com/vslangfutures/Thread/View.aspx?ThreadId=602</link><description>&lt;div class="wikidoc"&gt;
Ok, I love this, but can somebody please tell me how to enable it in my VS 2010 B2. For the love of this product, I cannot see how to enable/install it!&lt;br /&gt;
&lt;/div&gt;</description><author>Rykie</author><pubDate>Thu, 22 Oct 2009 02:04:02 GMT</pubDate><guid isPermaLink="false">NEW POST: Future Focus: Document Map Margin  20091022A</guid></item><item><title>NEW POST: optional keyword for interfaces</title><link>http://code.msdn.microsoft.com/vslangfutures/Thread/View.aspx?ThreadId=2228</link><description>&lt;div class="wikidoc"&gt;
Wait a minute, I forgot that OptionalMethod, if implemented could throw an exception, which we don't want to lose.&lt;br /&gt; &lt;br /&gt;IMyInterface obj = GetAnIMyInterfaceObject();&lt;br /&gt;obj.NotOptionalMethod();&lt;br /&gt;try &lt;br /&gt;{&lt;br /&gt;      obj.OptionalMethod();&lt;br /&gt;} &lt;br /&gt;catch(NotImplemetedException nex)   &lt;br /&gt;{}&lt;br /&gt;catch(Exception)&lt;br /&gt;{&lt;br /&gt;      throw;&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;And if that's not example enough, consider if there were three optional method in that interface.  For my technique, it's just:&lt;br /&gt; &lt;br /&gt;obj.NotOptionalMethod1();&lt;br /&gt;if(obj2 != null)  obj2.OptionalMethod1();&lt;br /&gt;obj.NotOptionalMethod2();&lt;br /&gt;if(obj2 != null)  obj2.OptionalMethod2();&lt;br /&gt;obj.NotOptionalMethod3();&lt;br /&gt;if(obj2 != null)  obj2.OptionalMethod3();&lt;br /&gt; &lt;br /&gt;Try duplicating that with try/catch.....&lt;br /&gt; &lt;br /&gt;
&lt;/div&gt;</description><author>JamesCurran</author><pubDate>Fri, 18 Sep 2009 21:01:33 GMT</pubDate><guid isPermaLink="false">NEW POST: optional keyword for interfaces 20090918P</guid></item><item><title>NEW POST: optional keyword for interfaces</title><link>http://code.msdn.microsoft.com/vslangfutures/Thread/View.aspx?ThreadId=2228</link><description>&lt;div class="wikidoc"&gt;
&amp;gt;&amp;gt; . You are saying that if I'm using some new feature of the language, I'll destroy the point of the base of that feature.&lt;br /&gt; &lt;br /&gt;Of course I'm not.  You are not merely adding some new feature, you are changing the way an existing feature works.  A more relevant example would be to ask that this would work:&lt;br /&gt; &lt;br /&gt;var i = 0;&lt;br /&gt;i = &amp;quot;Hello, World&amp;quot;;&lt;br /&gt; &lt;br /&gt;In the first line, i is an int regardless of whether you use &amp;quot;var&amp;quot; or &amp;quot;int&amp;quot;.  However, to allow the second line to work, you must change the very definition of what it means to be an int.  No one could ever again trust an int to be an int, even if they didn't use that new feature.   Which brings us to you major point:&lt;br /&gt; &lt;br /&gt;&amp;gt;&amp;gt; If you will not going to use this keyword, you'll still have the same &amp;quot;fixed &amp;quot; contract. &lt;br /&gt; &lt;br /&gt;No I don't.  The purpose is interface isn't for classes that I implement &amp;amp; use --- They are for classes implemented by one person and used by another.   If you were to give me a class that you wrote and tell me that it implements IMyInterface, then I have the right to assume that it implements &lt;b&gt;ALL&lt;/b&gt; of the interface.   But with your proposal, I can no longer do that.  Every place I use OptionalMethod(), I now have to wrap in in a try block to catch a potenial NotImplemetedException.   The POINT of interfaces is knowing that the implementation is there without having to worry about that.  (Which is why I said that using NotImplementException is cheating--- An interface method should NEVER throw NotImplementException; the method should be implemented)&lt;br /&gt; &lt;br /&gt;I think the best way to show the problem is with an example of use:  &lt;br /&gt;Task: Given an object which implements IMyInterface, call NotOptionalMethod(), and, if present, OptionalMethod():&lt;br /&gt; &lt;br /&gt;Your plan, with optional members:&lt;br /&gt;IMyInterface obj = GetAnIMyInterfaceObject();&lt;br /&gt;obj.NotOptionalMethod();&lt;br /&gt;try &lt;br /&gt;{&lt;br /&gt;     obj.OptionalMethod();&lt;br /&gt;} &lt;br /&gt;catch {}&lt;br /&gt; &lt;br /&gt;My plan, with two interfaces:&lt;br /&gt; &lt;br /&gt;IMyInterfaceBasic obj = GetAnIMyInterfaceObject();&lt;br /&gt;obj.NotOptionalMethod();&lt;br /&gt;var obj2 = obj as IMyInterfaceExtended;&lt;br /&gt;if (obj2 != null)&lt;br /&gt;     obj2.OptionalMethod();&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;Which is easier to read &amp;amp; understand?  which will run faster?&lt;br /&gt;
&lt;/div&gt;</description><author>JamesCurran</author><pubDate>Fri, 18 Sep 2009 16:39:48 GMT</pubDate><guid isPermaLink="false">NEW POST: optional keyword for interfaces 20090918P</guid></item><item><title>NEW POST: optional keyword for interfaces</title><link>http://code.msdn.microsoft.com/vslangfutures/Thread/View.aspx?ThreadId=2228</link><description>&lt;div class="wikidoc"&gt;
Well James, maybe this is why I don't &amp;quot;like&amp;quot; interfaces. Because they are &amp;quot;fixed&amp;quot; contracts. :)&lt;br /&gt; &lt;br /&gt;But I don't understand why are you keep saying that this keyword will destroy the point of interfaces. If you will not going to use this keyword, you'll still have the same &amp;quot;fixed &amp;quot; contract. You are saying that if I'm using some new feature of the language (let's say declaring a variable using var) I'll destroy the point of the base of that feature(e.g. declaration of an int. I can easily write var i = 0; of cource I can write int i = 0;)&lt;br /&gt; &lt;br /&gt;Thowing the NotImplementedException is not cheating. It's a fact! If you try to invoke a method at run-time of an object that has no implementation of that method, you will get an exception - it's real life, it's a fact!&lt;br /&gt;Regarding your example with two interfaces (don't get me wrong, I have nothing against interfaces... they are usefull in some cases, in other cases abstract classes are the way to go)... maybe I don't need to implement all methods exposed by an interface. Of course, I could use two interfaces as a workaround - no objection to that. If you want to implement only OptionalMethod(), what would you do? Create a third interface that implements both interfaces to ensure both OptionalMethod and NotOptionalMethod functionalities...&lt;br /&gt; &lt;br /&gt;Anyways, thanks for posting! :)&lt;br /&gt;
&lt;/div&gt;</description><author>eusebiu</author><pubDate>Fri, 18 Sep 2009 11:50:06 GMT</pubDate><guid isPermaLink="false">NEW POST: optional keyword for interfaces 20090918A</guid></item><item><title>NEW POST: optional keyword for interfaces</title><link>http://code.msdn.microsoft.com/vslangfutures/Thread/View.aspx?ThreadId=2228</link><description>&lt;div class="wikidoc"&gt;
So, basically, &amp;quot;optional&amp;quot; is a marker, telling the compiler to generate a simple method for those members which do not provide one.   That's probably better handled with an attribute than with a keyword, but you still have the fundelmental problem.&lt;br /&gt; &lt;br /&gt;The point of interfaces is to have a fixed contract.   Technically, having a interface method that throws NotImplementedException is cheating.&lt;br /&gt; &lt;br /&gt;As I user of a class which implements IMyInterface, I want to avoid calling a method which will throw a NotImplemented Exception.  How could I know that under your proposal.  In theory, if a class implements IMyInterface, then I should know with certitude that all it's methods are implemented.  That is the purpose of interfaces, and your purposal destroys that.&lt;br /&gt; &lt;br /&gt;OTOH, using two interfaces, I know immediately (using a simple test, built into the language) that MyClass2 implements OptionalMethod while MyClass1 does not.&lt;br /&gt; &lt;br /&gt;What is your opposition to using two interfaces???  (They're FREE!  Use as many as you want!)&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt;
&lt;/div&gt;</description><author>JamesCurran</author><pubDate>Thu, 17 Sep 2009 18:31:01 GMT</pubDate><guid isPermaLink="false">NEW POST: optional keyword for interfaces 20090917P</guid></item><item><title>NEW POST: optional keyword for interfaces</title><link>http://code.msdn.microsoft.com/vslangfutures/Thread/View.aspx?ThreadId=2228</link><description>&lt;div class="wikidoc"&gt;
First of all, thanks for posting...&lt;br /&gt; &lt;br /&gt;@danielerwicker: If you call an optional method that has no implementation in the class, a NotImplementedException() will throw. Of course, you can write classes that implements the optional method too.&lt;br /&gt; &lt;br /&gt;@JamesCurran: I don't think it will destroy the point of interfaces. This keywork will allow interfaces to be more extensible (in my opinion! :) ). And I will use only one interface... not two! &lt;br /&gt;
&lt;/div&gt;</description><author>eusebiu</author><pubDate>Thu, 17 Sep 2009 17:18:30 GMT</pubDate><guid isPermaLink="false">NEW POST: optional keyword for interfaces 20090917P</guid></item><item><title>NEW POST: optional keyword for interfaces</title><link>http://code.msdn.microsoft.com/vslangfutures/Thread/View.aspx?ThreadId=2228</link><description>&lt;div class="wikidoc"&gt;
I fail to see a problem that would to solve, and as daniel points out, causes new one.   (it would, in fact, completely destroy the point of interfaces, which are a fixed contract of members provided)&lt;br /&gt; &lt;br /&gt;This could very easily (and safely) been done today --- by just using &lt;b&gt;two interfaces&lt;/b&gt;:&lt;br /&gt; &lt;br /&gt;|     interface IMyInterfaceBasic&lt;br /&gt;|     {&lt;br /&gt;|            void NotOptionalMethod();&lt;br /&gt;|     }&lt;br /&gt; &lt;br /&gt;|     interface IMyInterfaceEnhanced : IMyInterfaceBasic&lt;br /&gt;|     {&lt;br /&gt;|        void OptionalMethod();&lt;br /&gt;|     }&lt;br /&gt; &lt;br /&gt;|     public class MyClass1 : IMyInterfaceBasic   {..... }&lt;br /&gt;|     public class MyClass2 : IMyInterfaceEnhanced   {..... }&lt;br /&gt;
&lt;/div&gt;</description><author>JamesCurran</author><pubDate>Fri, 11 Sep 2009 14:33:47 GMT</pubDate><guid isPermaLink="false">NEW POST: optional keyword for interfaces 20090911P</guid></item><item><title>NEW POST: optional keyword for interfaces</title><link>http://code.msdn.microsoft.com/vslangfutures/Thread/View.aspx?ThreadId=2228</link><description>&lt;div class="wikidoc"&gt;
What would happen if I called an optional method that the class did not implement?&lt;br /&gt;
&lt;/div&gt;</description><author>danielearwicker</author><pubDate>Fri, 11 Sep 2009 12:30:56 GMT</pubDate><guid isPermaLink="false">NEW POST: optional keyword for interfaces 20090911P</guid></item><item><title>NEW POST: optional keyword for interfaces</title><link>http://code.msdn.microsoft.com/vslangfutures/Thread/View.aspx?ThreadId=2228</link><description>&lt;div class="wikidoc"&gt;
Wouldn't be nice if C# had a optional keyword for the methods/properties in an interface?&lt;br /&gt;interface IMyInterface&lt;br /&gt;{&lt;br /&gt; optional void OptionalMethod();&lt;br /&gt; &lt;br /&gt; void NotOptionalMethod();&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;public class MyClass1 : IMyInterface&lt;br /&gt;{&lt;br /&gt; public void NotOptionalMethod()&lt;br /&gt; {&lt;br /&gt;  //implement the method...&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;public class MyClass2 : IMyInterface&lt;br /&gt;{&lt;br /&gt; public void NotOptionalMethod()&lt;br /&gt; {&lt;br /&gt;  //implement the method...&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public void OptionalMethod()&lt;br /&gt; {&lt;br /&gt;  //implement the method...&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;
&lt;/div&gt;</description><author>eusebiu</author><pubDate>Thu, 03 Sep 2009 10:54:02 GMT</pubDate><guid isPermaLink="false">NEW POST: optional keyword for interfaces 20090903A</guid></item><item><title>NEW POST: parent Keyword in C#</title><link>http://code.msdn.microsoft.com/vslangfutures/Thread/View.aspx?ThreadId=1803</link><description>&lt;div class="wikidoc"&gt;
This is basically the same thing as inner classes in Java, also known as non-static nested classes. The compiler automatically adds a reference to the outer class, and ensures that it is initialised in construction (as long as the 'new' happens inside a method of the outer class).&lt;br /&gt; &lt;br /&gt;C# already has something more powerful along the same lines: general closures. You can write an anonymous method and it can refer to anything visible in the context it refers to. Java's inner classes are like a poorer version of this.&lt;br /&gt;
&lt;/div&gt;</description><author>danielearwicker</author><pubDate>Sat, 13 Jun 2009 09:08:18 GMT</pubDate><guid isPermaLink="false">NEW POST: parent Keyword in C# 20090613A</guid></item><item><title>NEW POST: parent Keyword in C#</title><link>http://code.msdn.microsoft.com/vslangfutures/Thread/View.aspx?ThreadId=1803</link><description>&lt;div class="wikidoc"&gt;
I was working on some class structures over the past couple of days and it occurred to me that it would be extremely nice if a member class could directly impact the parent without the need to pass in a reference to the parent, like this:&lt;br /&gt; &lt;br /&gt;public class x&lt;br /&gt;{&lt;br /&gt;     public void DoSomethingToParent()&lt;br /&gt;     {&lt;br /&gt;          parent.DoSomething();                    // OK&lt;br /&gt;          parent.DoSomethingElse();              // NOT OK - method not exposed (see below)&lt;br /&gt;     }&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;public class y&lt;br /&gt;{&lt;br /&gt;     private x m_x;&lt;br /&gt; &lt;br /&gt;     public y()&lt;br /&gt;     {&lt;br /&gt;          x.DoSomethingToParent();&lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt;     &lt;a href="http://code.msdn.microsoft.com/vslangfutures/Wiki/View.aspx?title=ExposeToMemberClass"&gt;ExposeToMemberClass&lt;/a&gt;&lt;br /&gt;     public void DoSomething()&lt;br /&gt;     {&lt;br /&gt;          return &amp;quot;Hello World&amp;quot;;&lt;br /&gt;     }&lt;br /&gt; &lt;br /&gt;     public void DoSomethingElse()&lt;br /&gt;     {&lt;br /&gt;          return &amp;quot;Can't use me with parent keyword&amp;quot;;&lt;br /&gt;     }&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;If the method isn't exposed to member classes, then it can't be called from within the member class. Constructors couldn't be exposed and neither could private methods/properties/etc.&lt;br /&gt; &lt;br /&gt;Simple enough request - just occurred to me today. Would make things simpler in my opinion.&lt;br /&gt; &lt;br /&gt;Thanks,&lt;br /&gt; &lt;br /&gt;James&lt;br /&gt; &lt;br /&gt;  &lt;br /&gt;
&lt;/div&gt;</description><author>JamesThomas</author><pubDate>Thu, 28 May 2009 22:21:33 GMT</pubDate><guid isPermaLink="false">NEW POST: parent Keyword in C# 20090528P</guid></item><item><title>NEW POST: C# native tuple support?</title><link>http://code.msdn.microsoft.com/vslangfutures/Thread/View.aspx?ThreadId=316</link><description>&lt;div class="wikidoc"&gt;
Wow. Loads of Tuples.&lt;br /&gt; &lt;br /&gt;http://msdn.microsoft.com/en-us/library/dd383325(VS.100).aspx&lt;br /&gt; &lt;br /&gt;No syntactic sugar, but never mind.&lt;br /&gt;
&lt;/div&gt;</description><author>rendle</author><pubDate>Tue, 19 May 2009 11:18:02 GMT</pubDate><guid isPermaLink="false">NEW POST: C# native tuple support? 20090519A</guid></item><item><title>NEW POST: Call Hierarchy</title><link>http://code.msdn.microsoft.com/vslangfutures/Thread/View.aspx?ThreadId=123</link><description>&lt;div class="wikidoc"&gt;
 &lt;br /&gt;In reply to your Furture Focus posting on Call Hierarchy:&lt;br /&gt; &lt;br /&gt;&amp;gt; How would you like to see us integrate the Call Hierarchy into the Call View, Object Browser, or other parts of the IDE.&lt;br /&gt; &lt;br /&gt;I definitely have a integration suggestion I do not  yet see discussed in this thread. &lt;br /&gt; &lt;br /&gt;It has been my practice the last 16 years to represent the call hierarchy within the (released) source code comments in method headers, for methods (many or most of them) having at most several callers and up to some maximum depth, like several levels above. This way, the comment addresses the second of these most important questions to the reader: What is to occur? How did I get here? What special considerations should I have in mind? I have found my code maintainability substantially enhanced by having the call hierarchy in the comments, though the presence there would be enhanced by tool support to keep the hierarchy current as the code evolves. Like my internal documentation, my preference is to embed this information in the code comments where it is significantly more likely to be referenced than if a tool action is required in order to view it, and where it will be included and appropriately placed in print outs of the code.&lt;br /&gt; &lt;br /&gt;As mentioned, I am well aware approaches to include the call history in the code comments will have limitations and not be workable for all cases. My point is rather the frequent cases where it is quite viable, and greatly promotes readability / maintainability. An imperfect approach that would be often usable, would be extremely helpful. Of course, a condensed representation would be the greatest help in this usage. For example, in my hand notation of the call hierarchy, I use where practicable a (nestable of course) comma delimited list of callers to a common child level. This is the type of thing however where discussion of representation could be paralyzing to delivery of the feature: just have the designer pick a reasonable representation appropriate for use within code comments and run with it. I do think if you agree with the basic feature, an additional comment type such as &amp;quot;called by&amp;quot; would be appropriate.&lt;br /&gt; &lt;br /&gt;Thank you for your consideration and discussion toward supporting call hierarchy within source comments, and for all your fabulous work (I get 10 times more done now thanks to your great tools, and I am looking forward to another 10x boost from you in the foreseeable future).&lt;br /&gt; &lt;br /&gt;
&lt;/div&gt;</description><author>dan20</author><pubDate>Mon, 11 May 2009 17:18:46 GMT</pubDate><guid isPermaLink="false">NEW POST: Call Hierarchy 20090511P</guid></item><item><title>NEW POST: Static Extension Methods</title><link>http://code.msdn.microsoft.com/vslangfutures/Thread/View.aspx?ThreadId=269</link><description>&lt;div class="wikidoc"&gt;
//sorry double post&lt;br /&gt;
&lt;/div&gt;</description><author>avalon</author><pubDate>Wed, 04 Mar 2009 10:40:38 GMT</pubDate><guid isPermaLink="false">NEW POST: Static Extension Methods 20090304A</guid></item><item><title>NEW POST: Static Extension Methods</title><link>http://code.msdn.microsoft.com/vslangfutures/Thread/View.aspx?ThreadId=269</link><description>&lt;div class="wikidoc"&gt;
I think this should be possible aswell.&lt;br /&gt;I was looking for a static Copy() method in the Directory class but couldn't find any so decided to add it as an extension.&lt;br /&gt;But because an extension can only be added to a non-static class I had to add it to the DirectoryInfo class.&lt;br /&gt;Now everytime I want to copy a folder, I have to create an instance of the DirectoryInfo class and use my Copy extension.&lt;br /&gt; &lt;br /&gt;Extending a static method to a static class would make this sooo much nicer!&lt;br /&gt;Why isn't this possible?&lt;br /&gt;And I don't want the 'create your own class' response, the Directory and DirectoryInfo classes are sealed.&lt;br /&gt; &lt;br /&gt;here's my extension code:&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
    public static class DirectoryInfoExtensions
    {
        public static bool Copy(this System.IO.DirectoryInfo dir, string SourceFolder, string DestinationFolder)
        {
            if (!Directory.Exists(DestinationFolder))
                Directory.CreateDirectory(DestinationFolder);
            string[] files = Directory.GetFiles(SourceFolder);
            foreach (string file in files)
            {
                string name = Path.GetFileName(file);
                string dest = Path.Combine(DestinationFolder, name);
                File.Copy(file, dest);
            }
            string[] folders = Directory.GetDirectories(SourceFolder);
            foreach (string folder in folders)
            {
                string name = Path.GetFileName(folder);
                string dest = Path.Combine(DestinationFolder, name);
                Copy(dir, folder, dest);
            }
            return true;
        }
 
    }
&lt;/pre&gt;
&lt;/div&gt;</description><author>avalon</author><pubDate>Wed, 04 Mar 2009 10:40:35 GMT</pubDate><guid isPermaLink="false">NEW POST: Static Extension Methods 20090304A</guid></item><item><title>NEW POST: AOP support in c# v4</title><link>http://code.msdn.microsoft.com/vslangfutures/Thread/View.aspx?ThreadId=1292</link><description>&lt;div class="wikidoc"&gt;
Hi,&lt;br /&gt; &lt;br /&gt;Not sure this is the right place, but I would like to know will proper aspect oriented programming be supported in c# v4? By proper I mean unintrusive AOP with pointcuts separately defined and configurable, not just attributes applied directly to target types or methods.&lt;br /&gt; &lt;br /&gt;Regards,&lt;br /&gt; &lt;br /&gt;Sharas&lt;br /&gt;
&lt;/div&gt;</description><author>Sharas</author><pubDate>Mon, 09 Feb 2009 21:02:46 GMT</pubDate><guid isPermaLink="false">NEW POST: AOP support in c# v4 20090209P</guid></item><item><title>NEW POST: C++ style arithmetic conversions</title><link>http://code.msdn.microsoft.com/vslangfutures/Thread/View.aspx?ThreadId=1064</link><description>&lt;div class="wikidoc"&gt;
A better way to implement this (without adding new constructors to the built in types) is to have the compiler use conversion operators as well as constructors:&lt;br /&gt; &lt;br /&gt;int i = int(Math.sin(a)*100);&lt;br /&gt; &lt;br /&gt;When the compiler sees &amp;quot;int&amp;quot; (or &amp;quot;new int&amp;quot;), it first looks for a constructor.  Finding none, it looks for an implicit conversion operator.  Finding none, it uses the explicit double to int conversion operator.&lt;br /&gt; &lt;br /&gt;-Jeremy&lt;br /&gt;
&lt;/div&gt;</description><author>JeremyAtGosub</author><pubDate>Wed, 10 Dec 2008 21:42:32 GMT</pubDate><guid isPermaLink="false">NEW POST: C++ style arithmetic conversions 20081210P</guid></item><item><title>NEW POST: C++ style arithmetic conversions</title><link>http://code.msdn.microsoft.com/vslangfutures/Thread/View.aspx?ThreadId=1064</link><description>&lt;div class="wikidoc"&gt;
One of my pet peeves is having to use a cast to convert between simple types, like this:&lt;br /&gt; &lt;br /&gt;int i = (int)(Math.sin(a)*100);&lt;br /&gt; &lt;br /&gt;I propose we do two things that will make the code easier to read.  First, add constructors to the built in types that can convert.  This allows:&lt;br /&gt; &lt;br /&gt;int i = new int(Math.sin(a)*100);&lt;br /&gt; &lt;br /&gt;Second, make the &amp;quot;new&amp;quot; keyword optional when creating a struct.  Keep the &amp;quot;new&amp;quot; keyword mandatory for classes.  This allows:&lt;br /&gt; &lt;br /&gt;int i = int(Math.sin(a)*100);&lt;br /&gt; &lt;br /&gt;I'm not sure how much code this would break, but I bet the compiler can figure it out 99.9% of the time (and flag it as an error in the other 0.1%)&lt;br /&gt; &lt;br /&gt;Another problem with the base classes is that many of the struct types don't define the math operators and conversions.  Many times, I find myself wishing I could use operators on them:&lt;br /&gt; &lt;br /&gt;Point p = myOldPoint + myCalculatedPoint*2;&lt;br /&gt; &lt;br /&gt;-Jeremy&lt;br /&gt;
&lt;/div&gt;</description><author>JeremyAtGosub</author><pubDate>Wed, 10 Dec 2008 20:35:49 GMT</pubDate><guid isPermaLink="false">NEW POST: C++ style arithmetic conversions 20081210P</guid></item><item><title>NEW POST: I want Spec# (and Boogie)</title><link>http://code.msdn.microsoft.com/vslangfutures/Thread/View.aspx?ThreadId=814</link><description>&lt;div class="wikidoc"&gt;
I saw that, and was greatly pleased. It's going to make our testing cycle even more fun.&lt;br /&gt;
&lt;/div&gt;</description><author>Coder</author><pubDate>Thu, 04 Dec 2008 15:33:06 GMT</pubDate><guid isPermaLink="false">NEW POST: I want Spec# (and Boogie) 20081204P</guid></item><item><title>NEW POST: I want Spec# (and Boogie)</title><link>http://code.msdn.microsoft.com/vslangfutures/Thread/View.aspx?ThreadId=814</link><description>&lt;div class="wikidoc"&gt;
Microsoft Research has created a Code Contracts library for .NET (&lt;a href="http://research.microsoft.com/contracts/" class="externalLink"&gt;http://research.microsoft.com/contracts/&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;).  As a standalone framework, it can be used from any .NET language (not just C#), and it also includes compile-time static analysis similar to what was introduced in Spec#.&lt;br /&gt; &lt;br /&gt;I believe this library will be integrated into the .NET Base Class Library in v4.0.&lt;br /&gt;
&lt;/div&gt;</description><author>mstrobel</author><pubDate>Wed, 03 Dec 2008 18:33:26 GMT</pubDate><guid isPermaLink="false">NEW POST: I want Spec# (and Boogie) 20081203P</guid></item></channel></rss>