Share via


Visual Basic .NET Language Design

Posted August 10, 2003

Chat Date: July 29, 2003

Please note: Portions of this transcript have been edited for clarity

Chat Participants:

  • Paul Vick, Technical Lead for Visual Basic
  • Amanda Silver, program manager on the Visual Basic compiler team
  • Cameron Beccario, developer on the Visual Basic core compiler team
  • Harish Kantameri, VB compiler team
  • Corneliu Barsan, work in the VB compiler team
  • Cameron McColl, test lead for the Visual Basic Compiler
  • Osama Salem, developer on the core and IDE compiler

Moderator: Ed (Microsoft)
Welcome to today’s chat with the Visual Basic .NET Team on Language Design. We have members of the Visual Basic team here to answer your questions today. I will ask the hosts to introduce themselves.

Host: Amanda (Microsoft)
Hello everyone. My name is Amanda Silver. I am a program manager on the Visual Basic compiler team.

Host: Cameron (Microsoft)
My name is Cameron Beccario. I am a developer on the Visual Basic core compiler team.

Host: Harish (Microsoft)
Hi, my name is Harish Kantamneni. I work in the VB compiler team.

Host: Paul (Microsoft)
Hi, I'm Paul, the Technical Lead for Visual Basic, concentrating on the language and the compiler.

Host: Cameron (Microsoft)
Hi my name is Cameron McColl and I'm the test lead for the Visual Basic Compiler.

Host: Sam (Microsoft)
Hi, my name is Osama and I'm a developer on the core and IDE compiler.

Host: Corneliu (Microsoft)
Hi, my name is Corneliu Barsan. I work in the VB compiler team.

Moderator: Ed (Microsoft)
And I am Ed Hickey, VS Communities PM. Glad you all could make it today!

Let's get started! Fire away with your questions for our hosts.

Host: Paul (Microsoft)
Q: Why the method's ability to generate exceptions isn't declared like, say, in Java?

A: The C# team gets asked this a lot more than we do, and they have a prewritten answer that I think covers it pretty well.

Host: Paul (Microsoft)
Q: Why not make the output of VB.NET compiler accessible through a program interface? It would simplify creating such tools, make them cheaper, and in a way, safer and more standardized.

A: I think what you're asking for is more access to things like the parse trees, semantic information. The major problem is that exposing the internals of the compiler would be a lot of work, especially given all the specialized stuff we do for features like Intellisense. But this is something that we are thinking about going forward.

Host: Harish (Microsoft)
Q: When Properties of interfaces are exposed to COM, why is the relative order of the Get/Set methods in the vtable random? This makes adding members to the end of an existing vtable impossible with read/write properties.

A: This was a bug in VB.Net 2002 and is fixed in VB.Net 2003.

Host: Sam (Microsoft)
Q: Why does VB.Net not create a "release" and "debug" folder like C#?

A: The VB.Net compiler creates a "Debug" and "Release" directory under the obj directory. For both cases, the output is copied to the bin directory.

Host: Paul (Microsoft)
Q: In what way asserts are (or will) be introduced to the language? (pre-, postconditions, invariant conditions)

A: This is something that we continue to research. At this point, there is no definite plan for how or when (or if) we might introduce those kinds of things into the language. Stay tuned...

Host: Paul (Microsoft)
Q: At what stage now is introducing Templates? Is this rumor true? What syntax will they use?

A: Yes, we will be introducing generics in the next major version of the language, at the same time C# will. The syntax has not yet been finalized.

Host: Amanda (Microsoft)
Q: I've heard that in the coming releases, VB.Net will become more of a "wizard-based" language, while C# will become stronger with language features. Will they both still poses the same power?

A: I don't think "wizard-based" language is the best way to describe what the future of the Visual Basic language will be. That said, the two languages have different priorities. For Visual Basic that is productivity and firing off quick applications. For C# their intent is to focus on the coding experience. One thing is certain, if it is a central part of the .NET platform Visual Basic will have support for it.

Host: Harish (Microsoft)
Q: Why was the ability to have a public property get but a private/friend property let dismissed?

A: We are introducing this in a future version.

Host: Cameron (Microsoft)
Q: We need the ability to set the next statement to be executed when the debugger is stopped at an exception, as was possible in pre .NET versions. This really sped up debugging by allowing developer to take note of the error and continue working.

A: This is part of the work for Edit-and-Continue (EnC), which will be supported in the next version.

Host: Paul (Microsoft)
Q: Is there a place where we can vote for (and choose) preliminary variants of the new syntax, features, etc.?

A: Generally, we rely on our beta program for this kind of thing and that will continue. However, we're thinking about how we might be able to use the web to better engage the community.

Host: Amanda (Microsoft)
Q: Any plans for Event Properties (Add/Remove methods)? Some ComponentModel classes of the .NET Framework assume them, and it would be nice to be able to use them.

A: We are considering this for future versions. We would definitely like to understand which roadblocks you are hitting without them.

Host: Cameron (Microsoft)
Q: will we see operator overloading abilities in VB.Net?

A: Yes, we will support operator overloading in Whidbey.

Host: Cameron (Microsoft)
Q: What about indexer overloading? Will C++ be the only one to support this?

A: No, indexer overloading will not be supported in VB .Net. Just to clarify, you can overload indexed properties, which in a sense is overloading an "indexer". However, overloading the indexer operator, () in VB, [] in C++, won't be supported.

Host: Amanda (Microsoft)
Q: Will VB.NET have any refactoring tools?

A: We are considering this. We would like to learn exactly what kinds of refactoring features you would find useful.

Host: Paul (Microsoft)
Q: Code collapse is wonderful. But there is place for perfection. Do you dream about a revolution in source-code representation? Making it more "visual and interactive"? Like in Visual programming languages?

A: Yes, we do dream about this, but it is definitely long-term and still in the "dream" state.

Host: Harish (Microsoft)
Q: It would really be nice to be able to use the With statement with shared members, i.e. With System.Windows.Forms.Application...End With

A: We are considering this for a future version.

Host: Corneliu (Microsoft)
Q: Multiple inheritance?

A: There is no plan to introduce MI in VB.

Host: Paul (Microsoft)
Q: I find that calling arrays using "()" instead of "[]" pretty disturbing, because it makes the code less readable. will you support the ability to call array items using both styles?

A: Probably not. This would be extremely confusing (and possibly unresolably ambiguous) when compared against the existing use of [] for escaping identifiers.

Host: Paul (Microsoft)
Q: Will 'Option Strict On' be default in the next release?

A: This is a continuing topic of discussion. Our principle area of concern is that we don't wish to overwhelm upgraders and new developers with errors, but we do like the extra checking. It's still an open question at this point.

Host: Paul (Microsoft)
Q: Will there be a clean way to slightly change method signature in inherited class? I need to specify a precise argument type (not ClassA but ClassB, inheriting A). Now I have to use casting for that.

A: Probably not in the next release, although this is something we see the usefulness of and continue to talk about.

Host: Paul (Microsoft)
Q: If you continue to have "what type of programmer are you?" type profiles, you could create a "upgrader" programmer profile and set Option Strict On for everyone else?

A: Something we're definitely thinking about.

Host: Julian (Microsoft)
Q: Can you make the C# team make Intellisense as good as it is in VB.Net?

A: We're working on many improvements to Intellisense in C#. What, in particular are you looking for?

Host: Sam (Microsoft)
Q: Why don't we still have multi-line comments? and good XML documentation like C#?

A: We are planning on supporting XML comments for the next major version of VB.Net.

Host: Paul (Microsoft)
Q: Why can't I explicitly destroy an object? Either wait or implement IDisposable...

A: One of the safety features of the CLR is that you can't free memory that someone still has a reference to. Thus, you can't destroy an object without running the garbage collector. And reference counting is not really compatible with garbage collection, but an explanation of that would take a lot more space than is available here...

Host: Julian (Microsoft)
Q: Julian - I want enums to popup automatically when I need to pass them as a parameter to a function

A: Got it. I find it annoying too.

Host: Cameron (Microsoft)
Q: Why does the compiler emit a call to System.Runtime.CompilerServices.RuntimeHelpers.GetObjectValue whenever you pass an Object reference to an Object parameter?

A: The reason is because we do not want valuetype aliasing to occur. For example, assigning between Objects would copy only the _reference_ to a boxed valuetype. Modifying what the user thinks is a unique instance would in fact modify both copies, which we thought would be surprising and bad. Using reflection and CallByName isn't impossible because you can use System.ValueType. Assigning or passing System.ValueType's will NOT generate calls to GetObjectValue. In other words, you can force aliasing by using System.ValueType instead of Object to manipulate your valuetypes.

Host: Sam (Microsoft)
Q: Compile in background takes a _very_ long time on large projects. will this be fixed?

A: We are working on improving the performance of the background compilation. We are also working on reducing the delays experienced when editing in the editor inside large solutions. We also made several performance improvements to the background compilation process and editing inside the code editor for the VS2003 release.

Host: Paul (Microsoft)
Q: Talking to the UI from a second thread is problematic at best. Will there be an easier way like have the control class automatically check if InvokeNeeded() and such?

A: This is definitely an issue that we're aware of, and we've got some ideas for the next version that will simplify multithreaded UI coding (we hope). But nothing we can talk about right now, unfortunately.

Host: Amanda (Microsoft)
Q: Is there a way to declare variable to be visible just inside a control structure, such as If and For?

A: We already have this. If you "Dim" up a variable within an If or a For statement, it is only visible in the scope of that block.

Host: Paul (Microsoft)
Q: You did not answer about multi line comments

A: This has been kind of low priority since you can just comment the beginning of each line. A higher priority is comments after a line continuation. But at this point, no promises on doing anything, although we do know it's annoying.

Host: Paul (Microsoft)
Q: Is there (or will there be) a way to instruct the VB.NET compiler to INCLUDE another file in a VB.NET code module?

A: On the command-line, you can link together netmodules, but that doesn't work in the IDE. It sounds like you might be asking for something more like LINK from C++. We're looking at what we might be able to do there in the future.

Host: Amanda (Microsoft)
Q: Are static local variables supposed to be persisted during serialization? Currently they are (i.e. they aren't marked notserialized), if the containing type is serializable. ...

A: We recognize that this is somewhat unexpected behavior and are looking for a way to address it in the future.

Host: Sam (Microsoft)
Q: How large?

A: It depends on several factors, such as the machine configuration and the number and size of each project in the solution. In general, the VB.Net 2003 development environment should perform better than the VB.Net 2002 release.

Host: Paul (Microsoft)
Q: Paul, I agree that a low priority on continued comments is OK, however, a continued comment and two adjacent comments are simply not the same thing logically. That distinction may not matter much to people that do not parse and reformat code in macros. But to those of us that do, it is a very large distinction.

A: Understood, and it's good feedback for us.

Host: Paul (Microsoft)
Q: Will we be able to use Option Strict/late binding on a more granular level?

A: All I can say at this point is that we're thinking a lot about warnings and errors and how to better control them. But we are not definite on it yet.

Host: Paul (Microsoft)
Q: Where can we be notified about great events with design? Will there be an announcement at dotnet.languages.vb?

A: First, the MSDN developer center for VB will always be a great place to find out about events: https://msdn.microsoft.com/vbasic/default.aspx. There is also a list of VB blogs.

Host: Corneliu (Microsoft)
Q: Will VB.NET support warnings if there exists a code path in a function that doesn't return a value like C# does?

A: It is under discussion for one of the future verssions

Host: Paul (Microsoft)
Q: Is reference-counting being considered? (i.e will we ever have deterministic finalization?)

A: We spent a lot (and believe me, it was a _lot_) of time trying to figure out to make refcounting work in a GC world, and we ultimately concluded that they simply weren't compatible in any reasonable way. There's been some research external to Microsoft on replacing GC entirely with refcounting, but that's just research at this point...

Host: Harish (Microsoft)
Q: Any plans on improving conditional compilation? To make it possible to conditionally apply attributes or conditional parameter values in method calls for example.

A: We are considering this for a future version. Are there any particular scenarios besides the attributes ?

Host: Sam (Microsoft)
Q: There's an option to turn back-compilation off, right?

A: There is no option to turn off background compilation. The background compilation process is needed to produce compile errors and warnings without the need to explicitly build the project and to support IDE functionality, such as Intellisense and populating the Editor’s Drop Downs.

Host: Paul (Microsoft)
Q: Hello, I 'd like to Know if there is a way to use the parser of VB.net in my applications. (like the formula's editor of Crystall Report)

A: At this point, the only thing you can do is take the language specification and implement a parser yourself. We are aware, though, that an open parser would benefit people who want to manipulate VB code or use VB-like syntax, and it's something we think about. Opening up the compiler, though, is difficult because much of the code is so specialized in the way it works with the rest of the compiler and the IDE.

Host: Paul (Microsoft)
Q: Can we have the "Hide advanced members" unchecked by default, in fact, Why do we need it? it hides too much

A: We know the all-or-nothing option is a bit restrictive, so we're thinking about how to make things a bit more configurable in the future.

Moderator: Ed (Microsoft)
This has been a GREAT chat. Thank you to everyone. Unfortunately, it is time to go. Thanks for participating, and we'll see you next time!

Host: Amanda (Microsoft)
Alright everyone! Thanks so much for coming to the chat today! Hope to see you soon!

Host: Paul (Microsoft)
Bye guys! It's been great chatting, and I'm sure we could spend a few more hours talking! Talk to you all later!

For further information on this topic please visit the following:

Newsgroups: microsoft.public.dotnet.languages.vb

VB .NET Transcripts: Read the archive of past VB .NET chats.

Website: Visit the Microsoft Visual Basic .NET site.

Top of Page Top of Page