Some time ago, frustrated with my RSS reader being overrun by VS2008 beta announcements, I wrote a short post announcing the release of VS 2009 beta 1. And although there are some calls to re-brand the most recent service pack, I doubt we’ll see this version.
Instead we got Visual Studio 2010, with new features such as support for cloud computing, parallel extensions, ASP.NET MVC, etc.
Frankly, I’m not that excited.
Most of the features to be included in the upcoming version are already available to developers as additions to existing developing tools (although most are in CTP mode at the moment).
There ARE the new features of C# 4.0, but unlike the changes between 1.1 and 2.0, the most recent set of changes is “nice to have” at most.
What is more impressive (in my opinion) are the changes and improvements in the new Visual Studio Team System package, which had a lot of room for improvement even after the latest service pack, and especially the new and improved tester version.
Considering the release of VS2008, we’ll probably be able to see a stable version (beta 2) at the second half of the year 2009.
Anders Hejlsberg, Mads Torgersen and Eric Lippert discuss the new features of C# 4.0
(If you use Visual Studio 2003 or you tend to ignore compiler warnings, this post is for you)
Static classes and members have their uses. However, I recently encountered a dangerous pitfall regarding their usage.
Consider the following code:
public static class MyClass
{
public static int myVal = MyClass.myVal;
public static MyOtherClass myClass = MyClass.myClass;
public static Color myColor = MyClass.myColor;
}
Can you spot what is wrong here?
You got it right - this class assign it’s members back to themselves, effectively avoiding assigning them.
If you try using this code using VS2003 it will compile without any notification. In more recent version you’ll only get a compiler warning.
What’s worse yet: you can make the member private and the code would still compile.
But it can get even worse: Since these members are not assigned, with value types you’ll get the default value, while with most classes you’ll have a null reference.
But the Color struct is something different. It retains an Empty value, and if your winform application uses the default theme and colors, assigning an empty color to a control basically does nothing.
Now try understanding why your panel refuses to change color….