Edit & Continue and Other Features
After the break we started talking about C# getting Edit and Continue in C# 2.0, and that led into a discussion of some more features of Visual Basic 2005.
: C# users I'm sure are delighted to be getting Edit and Continue. If only they were getting My
Rory: Yeah, but we can use My, can't we?
Jay: You can use parts of My. My is actually two things. There are sections of My that are shortcuts into the .NET Framework. So, things like My.Computer.FileSystem.ReadAllText is a shortcut into the Framework. So if you imported the Microsoft.VisualBasic namespace, you could go use that type of stuff from within C#, although you wouldn't have the keyword My at the top.
There are other things like settings and Web services and resources that are generated on the fly in the background for you. So that stuff is specific to your project, and C# isn't going to get that part of My.
Rory: Wow! Oh, Crap! I was thinking the whole time that I could just set a reference and start using it. Well, while we're talking about that you want to talk about the refactoring story for Whidbey in VB?
Jay: Well, in 2005, VB is going to have the Rename symbol. We took a look at adding some more of the other refactorings because we've heard from people in the community that they'd love to have some more of them, and we just can't make it work.
Rory: So, what you're telling me is that C# developers get part of the My namespace and VB developers get some of the refactoring abilities of C#. Bam! Oh yeah! [laughs] Sorry. I felt one-upped there for a minute and I felt I had to kind of strike back a little bit. I'm a C# guy, and I was totally bummed about not getting the My namespace, but as long as we get something in there to make up for it...
Jay: We're actually working with a few partners [to do some of these things in VB.NET] because we know there are so many people out there who want it, and we want to add them in there in the next version of VB.
Carl: Let me ask you this. You said that you just couldn't do it. Do you mean that technically it wasn't possible to do the refactoring stuff? It seems odd to me.
Jay: Technically anything's possible. But it's a question of how do we deliver VB 2005 when everybody wants it. I've just come back from this VB user group tour where we've had people go to about 40 cities all around the world. And the main message that we get when we demo 2005 is "ship!" So, what's the cost in doing it in terms of the technical aspects, and also the overall schedule?
Rory: What you do have though is those code-snippet thingies.
Jay: Yeah, we're going to have about 500 of those [as well as IntelliSense expansions in C#]. We're actually doing a bunch more work to let you get to whatever type of IntelliSense expansion you want. So if you want the If loop written out for you, we're actually introducing the question mark syntax which is similar to what C# uses. The place people should go to check that out is the Visual Basic Team Blog at http://blogs.msdn.com/vbteam/ .
Carl: You made a comment at a user group meeting that some things in the Microsoft.VisualBasic namespace are faster than their framework counterparts. Can you elaborate a little on that?
Jay: I think the thing we were talking about was CType in the Microsoft.VisualBasic namespace. CType is one of those things where we did a lot of work to make sure that it keeps the VB6 functionality because we know there are a lot of people that are used to that. [CType] does a lot more than, say, Convert.ToInt32 just in terms of the different types of parsings that it does.
So if you're trying to get that same type of behavior that you get with CType, it's easier to use CType than it is to actually go in and emulate that using the various .NET Framework calls that you'd have to make.
One of the things that everyone will notice about Visual Studio 2005 is just how much snappier performance has gotten around things like IDE startup and just the general behavior of the environment. I know that there are a couple of performance issues in the beta that we're working on, but people are going to see really stepped-up performance.
This was a really cool interview experience for me. It was great to finally understand how the StringBuilder works. Even though he didn't describe those "special APIs" I have a pretty good idea of what they do, and now so do you.
If you haven't listened to our show, please do. One word of warning, however. The shows between January 1, 2004 and November 15, 2004, contain adult-oriented humor. We started in January 2004 with Rory Blyth as the co-host and we delved into some comedy that had nothing to do with programming. Starting in November, 2004, .NET Rocks! is going back to its roots as an interview-only show. To fill our needs to be wacky, we started another show for a general geek-oriented audience called Mondays, which you can check out online at http://mondays.pwop.com.