Category Archives: Visual Basic

Will VB ever be standardized?

Someone recently sent me a question that comes up every now and again:

C# has been submitted and approved by the ECMA, will Visual Basic ever be submitted?

Well, never say never, but there are no current plans to submit Visual Basic to a standards body. The idea has certainly been discussed internally from time to time, but we’ve usually gotten stuck on several points:

  • By and large, the demand for this from developers has been very low, at least in terms of the people that we talk to in customer visits, trade shows, conferences, online, etc. Now, it’s always possible that there’s a latent demand out there for standardization of VB, and we’re always interested to hear people’s feedback on this, so let us know if this would make a big difference for you for some reason.
  • Having watched the C# team go through the process, it’s clear that standardizing a language through a standards body requires a significant amount of work. And a good chunk of that work has very little to do with the actual content of the standard and a lot to do with the general process overhead of publishing a standard. Given the previous bullet point, that makes us loath to dedicate resources to standardization that might be used productively elsewhere.
  • From a more philosophical (and personal) standpoint, there just seems to be something… I dunno, wrong about trying to standardize a variant of BASIC. I know that there was an ANSI standard BASIC many years ago (I have a copy of it up on my shelf), but I think that BASIC has probably been one of the most un-standard programming languages ever when you take into account the myriad of variants of the language over the past three and a half decades. I wouldn’t want us to jinx ourselves or anything…

OK, that last point isn’t really a reason why we haven’t approached standardization, but it is something I like to throw in to this conversation when it comes up. As I said, though, we’re always open to hearing what you have to say about this subject, so if you have a strong opinion, leave a comment or drop me a line through the comment form!

The wheel turns on samples…

This is a bit of old news, but I did want to point out that we have heard the feedback about the relative dearth of VB samples in the past few releases and now MSDN and Microsoft as a whole has been consciously shifting their focus. Tom makes some interesting observations about the readability of the different languages for different types of developers and there’s some lively discussion in the comments, well worth checking out!

Free training on VB 2005…

On a happier note… Brad McCabe passed along some info about free training that MSDN is offering for VB 2005 and/or ASP.NET 2.0. To quote him:

With the holiday’s coming lots of people have some extra time on their hands, with this in mind MSDN and Microsoft Learning got to together to give you something to do, free training!

We were trying to figure out what course to give away and decided to let you pick.  That’s right pick one of 6 courses about Visual Basic 2005 or 9 courses about ASP.NET 2.0.  In addition, after you have completed your free online course you will receive 30% off the price of the next one.

You have to hurry, the free code is only good until January 4th, 2006.  You don’t have to take your free class by then, but you have to sign up and select your class before that day.  You have 90 days from the time you sign up to do the course, but with spare time this holiday season why not do it now?

Visit http://msdn.microsoft.com/vstudio/learning/elearning_promo/ for all of the details and to get the free training code to sign up.

Not too shabby!

More Japanese content…

In addition to my interview with the ITPro website, I’ve also got a personal webpage on MSDN Japan. It has links to things like an interview I did with Takashi Tsujigo, an evangelist from MSDN Japan, and an interview with @IT. I believe there are also going to be some webcasts up before long. Unfortunately, I don’t believe there are any English translations available for any of the content, although I don’t think I said anything secret that I haven’t said elsewhere… <g>

Extension methods + late binding = trouble?

I’m clearing out some old mail and I came across a reference to a blog entry by Jon Skeet about extension methods that I saved a while back. He says:

One of the things I don’t like about the proposed extension methods is the way the compiler is made aware of them – on a namespace basis. “Using” directives are very common to add for any namespace used in a class, and quite often I wouldn’t want the extension methods within that namespace to be applied. I propose using using static System.Query.Sequence; instead, in a way that is analogous to the static imports of Java 1.5 (except without importing single members or requiring the “.*” part. This would make it clearer what you were actually trying to do.

The interesting thing is, if you look at the document that we released on LINQ at the PDC, you’ll see that our design for extension methods incorporates this suggestion: extension methods in VB are brought into scope by directly importing the containing type, not the namespace. Imports System.Query isn’t sufficient to get LINQ methods in scope; you have to say Imports System.Query.Sequence. I agree with Jon that it’s clearer to do it this way, but that’s not the whole reason we did it. You see, the real problem is late binding.

Yes, late binding. We still support that, you know? And if you think for a minute about late binding and extension methods the way C# does them, you’ll quickly see that the two things don’t go together very well. When we go to late bind a member “foo” on an instance of a type “bar” today things are relatively simple — we gather all the members of “bar” with the name “foo” and then apply our regular binding rules to determine which, if any, of them fit the bill. All we need to know at run-time is the type of the instance we’re late binding on. With extension methods, though, this breaks down. Now we need to know not just the type of the instance, but also all of the extension methods in scope at the point of invocation. That’s because if “bar” doesn’t have a member “foo,” then in the early-bound case the compiler is going to go looking for extensions method. And the late-binder needs to do this, too!

If you look at how C# does extension methods, they go out and start looking in all the enclosing namespaces for extension methods, then look in all the imported namespaces for extension methods, etc. Replicating this at run-time would be difficult, at best — at every late-bound invocation point you would have to capture the complete binding context. And this binding context would change from method to method. What a nightmare! Our design is more friendly to late-binding. Our current design says that if “bar” doesn’t have a member “foo,” then we’ll look only at types whose members have been imported for extension methods. This collapses down the search space hugely and also means that the binding context is per-file (since we only allow file-level imports, unlike C#). While still a bit bulky, this seems much more manageable. Although we’ll see — although we’ve implemented early-bound extension methods, we haven’t gotten to the late bound stuff yet. <g>

Although we felt we had to do extension methods this way because of late-binding, we also believe there are some other advantages to the scheme. Jon lists one: it becomes much easier to be clear about the extensions you are using. You won’t import some useful namespace and then, whoops!, you just added a whole bunch of extension methods that you didn’t want. It’s also fairly congruent with the fact that VB (again, unlike C#) allows you to import a type directly, allowing access to its shared members without qualification.

Of course, now that I think of it, I’m not sure how this works with standard modules and their special binding rules. Hmmmm. I’m going to have to look at that…

Japanese Launch of VB 2005

OK, well, now that I’ve had a chance to recover a bit from the jet-lag from flying back and forth from Tokyo in just three days, I thought I’d give a short update on how the launch went there.

Executive summary: Great!

This was my first experience presenting outside of the US, and it was very interesting. My main presentation on VB 2005 was simultaneously translated, but everything else was done sequentially. So I spent a lot of time saying one or two sentences, pausing, saying one or two more sentences, pausing, saying one or two more sentences, listening to the reply in Japanese, waiting, then hearing it in English. Rinse, repeat. The translators that I worked with were great, so it wasn’t difficult or anything, just a little… different. I did my PDC presentation for a small group of people and it took about twice as long as the original did. I’m also not sure how much of what I was saying got across — all the technical stuff did, for sure, but I think so much of the inflection and all gets, you know, lost in translation.

The special keynote that I did for VB 2005 seemed to go over well, although the fact that the audience was much more reticent that I was used to was a bit disconcerting at times. At first when I wasn’t getting any applause when demoing some of the cool VB 2005 stuff, I started to panic that I was doing something wrong, but then it smoothed itself out. Everyone seemed very excited and had lots of questions about the new version, VB6 migration, the future, etc. Overall, a wonderful experience!

My main regret was that I had to leave right after the conference was over… it would have been great to have been able to spend some time in Japan getting to see something more than the hotel I was staying in. Alas, the confluence of the conference and the impending Thanksgiving holiday made that impractical. Thankfully, I did get a chance to hang out a bit with Cameron Beccario, which was a treat. I tried to convince him to come back and help us out with LINQ, but he’s still pretty settled in Tokyo, unfortunately…

If you read Japanese, feel free to check out my special MSDN website that they put up for me. I’d also highly recommend the VS User Group (VSUG) website — I got a chance to talk with their founding members, and it looks like a great organization! (They said that usually user groups start in the US and then create a Japanese chapter — this time they’re starting the group in Japan, but are open to having a US chapter join. <g>) All in all, a great trip!

Upgrading Visual Basic 6.0 Applications to Visual Basic .NET and Visual Basic 2005

While I was at the Japanese launch (more on that soon), one of the questions that came up often was, unsurprisingly, about migration from VB 6. We continue to have the resources available on the VBRun website, but we’ve also had some new migration resources released recently by the MS Patterns and Practices Team (thanks to Jackie Goldstein for the link). Check them out!

VB language spec 8.0 now available…

We’ve now got the final version of the Visual Basic 8.0 Language Specification now up and available on MSDN! And, as it seems with everything these days, I’ve already gotten several bug reports for the samples. I guess I can go ahead and commit to shipping a service pack for the language specification in the near future…

Updated 11/26/05: Corrected link to language specification. (Thanks Roger!)