What’s in VB 2008? What’s out?

As a medium of communication, blogs have their strengths and weaknesses. The informal nature of the communication makes it incredibly easy to communicate information on an ongoing basis. The down side, of course, is that the very informality of blogs can also trip you up if you don’t pay enough attention to follow up. I’ve certainly been guilty of that on this blog (there are still some loose ends I think haven’t really been tied up), and we’ve been guilty of that as a team.

One thing we haven’t always done a good job of is keeping people apprised of feature decisions that we’ve made as the VB 2008 product cycle has progressed. As a result, there has been some confusion as to what features are in and which features are out of the product. So let me start by giving a reasonably concise list of the feature set for VB 2008…

General features

  • Friend assemblies. We now pay attention to the InternalsVisibleTo attribute.
  • Relaxed delegates. As long as there is a way to map one delegate’s parameters to another, you can now convert freely between delegate types. (I’d wanted to see this extended into full delegate currying, but that will have to wait for a future release.)
  • Runtime agility. The ability to compile without a VB runtime, or targeting another VB runtime.
  • Calling Object members on interfaces. Minor feature, but useful in some situations.
  • Ternary operator. A short-circuiting conditional expression like C’s ?: operator.
  • Improved generic type inferencing. In VB 2005, we would not infer a type for a type parameter that had multiple inferred types (i.e. a parameter T matched two arguments typed as Integer and Long). In VB 2008, we will now pick the wider of the two types. (Actually, it’s more complex than this, but you get the idea.)

LINQ

  • Local variable type inferencing.
  • Anonymous types.
  • Extension methods.
  • Nullable types.
  • Query expressions. This is the From…Where…Select… expression.
  • Object initializers. For VB 2008, we will only support initializing read-write fields of non-collection objects (more on this further down).
  • Expression trees.
  • Lambda expressions. For VB 2008, we will only support expressions in lambdas, not statements.
  • Partial methods.

XML

  • XML literals.
  • XML members.
  • XML namespaces.

I think most everything on this list has so far been discussed, with the exception of the omissions from object initializers. Our original plans, going back to PDC05, included several more features for object initializers, such as being able to write to read-only properties, as well as collection and array initializers. In the end, the schedule for VS 2008 was not sufficient to implement these features with a high degree of confidence. Which unfortunately means that they will have to wait to a release beyond VS 2008.

27 thoughts on “What’s in VB 2008? What’s out?

  1. Vincent Evans

    I apologize if it was mentioned elsewhere…

    Is there generics type inferring based on receiving type of the function?

    Function Foo() As T

    Return Bar As T

    End Function

    Usage:

    Dim IsInferred As Boolean = Foo() ”’ And i expect it to infer that T is boolean type.

    I looked into it briefly – and it appears that the only way to accompoish that – is to actually pass a bogus parameter just so that it can infer what T stands for?

    Reply
  2. Fan Shi

    I think the disappear of collection initializers is acceptable to me, but the array standalone initializer is really needed.

    In current version of VB. It is easy to create an "array initializer" function like VB6 (but better with generics):

    Function Array(Of T)(ByVal ParamArray elements As T()) As T()

    Return elements

    End Function

    With this, we can easily initialize a list or array parameters.

    Dim l As New List(Of String) (Array("Apple", "Banana", "Peach"))

    Foo(Array(1,2,3,4,5)) ‘Foo receives a Integer()

    But it’s only for one dimension. It would be really cool if we have a real language supported array standalone initializer for direct array literals.

    Reply
  3. Anthony D. Green, MCPD

    Oh man, {1, 2, 3} was such a cool thing for working with arrays, especially since intellisense is stupid on making arrays of types that don’t expose constructors. Anyone working with lots of reflection can feel me on this.

    Good stuff otherwise. I don’t mind putting things off to future versions, I just hate that future versions are like a multiyear condemnation. What with that actual CLR not changing since 2.0 I would really prefer language enhancements released out of band with the rest of the framework. I know for a language with the legacy concerns of VB this is hard but it’s a lot easier to download an update to the vbc and vs than it is to move source and more importantly client workstations to a new framework library and CLR.

    6-12 month agility for language level enhancements, how ’bout it?

    Reply
  4. Lennie

    Hi,

    Are there examples to demonstrate all the new features / changes?

    I like to learn from examples.

    Kind Regards,

    Lennie De Villiers

    Reply
  5. paulvick

    Vincent: This is something we’ve been discussing recently, but it’s not in Orcas, unfortunately…

    Anthony: We’d love to do things on a more aggressive cycle, but we haven’t really started planning concretely beyond Orcas…

    Lennie: There are a lot of good examples on http://blogs.msdn.com/vbteam/, and in MSDN as well. Check them out!

    Reply
  6. Pingback: Israel A

  7. Fan Shi

    Seems I can’t see some of the exciting features in this version…

    Hopes next version (VB X?) have enough design time and implement full functional as early commitments.

    Reply
  8. Pingback: Samurai Programmer.com

  9. Pingback: Panopticon Central

  10. Steven

    I’d like to see an auditing utility to scan a machine for compiled VB6 code or anything using VB6. We are targeting March 2008 as the date we have removed all VB6 code from our machines (including Com, DLL files, etc). This is an important first step for preparing our environment for Vista and Windows Server 2008.

    This is part of our larger business reliablity goal of ensuring all of our machines are using only recent (e.g., last 4 to 5 years) old code and applications.

    Windows OS, Office, SQL Server, Exchange are excluded from the VB6 requirement since we run the most recent version and that they are core products from Microsoft.

    Reply
  11. mrcdave

    I’ve been with vb6 for years and have only just moved to vb2008 and I like it generally. I’ve been able to get to grips with very quickly. I heard such bad press on VB.net didn’t bother with it.

    Good to see the serial port option back in, very useful.

    Reply
  12. Jon

    amI missing something here? is there a way to make an array of buttons? in vb6 I could take a set of 30 buttons and assign text to them from an array instead of having to label each one individualy, but now for some reason when I try it fails miserably. my old code:

    dim x as array

    for x = 1 to 30

    button(x).text = "Click for" + (x)

    next

    but this does not seem to work in the VB2008ee, am I missing something? did I do something wrong? I hate to have to type out each objects properties in length when an array makes the code so much nicer! any ideas?

    Reply
  13. David

    I’ve tried each version of VB.Net that has been released and have been immensely disappointed with each. I’ve always gone back to VB6.

    So;

    – when upgrading from VB6 to VS08, does the migration tool migrate all code, or am I still going to need to rewrite massive chunks of code?

    – Are VS08 Collections now properly backwards compatible to VB6 collections? Can I pass a VB6 collection from a COM dll and the VS08 application understand it?

    – Can it be compiled into ‘true’ executable and bypass IL all together? These unsecured IL’s are just silly.

    – Is the Edit and Continue fixed? I know it was there for VS05 but it never worked properly. Or at the very least, it never worked as well as VB6. Has that been fixed?

    – General IDE speed for all versions of VS was horrible. There were thousands of complaints about it. Is the IDE speed (when typing) at least as fast as VB6?

    – Is it possible to specify what upgrade warnings are inserted into your code when you migrate? That was a heavily requested migration tool feature. Everyone hated the thousands of lines of additional comments added to our code.

    – Where are our control arrays?

    – Has the execution speed been improved? Executables created with VS05 never ran as fast as those created with VB6.

    Reply
  14. David

    VB.Net 2008 …. you would really think that new versions would actually be improvements but alas, MicroSoft as turn the word "version" into something that means buggy, incomplete, and shoddy workmanship.

    I have been in the software design business for over 20 years and the industry has not gotten smarter…only more money hungry.

    It is the standard now to release software that simply does not work and MicroSoft is leading the way.

    Reply
  15. wa

    I’ve tried each version of VB.Net that has been released and have been immensely disappointed with each. I’ve always gone back to VB6.

    So;

    – when upgrading from VB6 to VS08, does the migration tool migrate all code, or am I still going to need to rewrite massive chunks of code?

    – Are VS08 Collections now properly backwards compatible to VB6 collections? Can I pass a VB6 collection from a COM dll and the VS08 application understand it?

    – Can it be compiled into ‘true’ executable and bypass IL all together? These unsecured IL’s are just silly.

    – Is the Edit and Continue fixed? I know it was there for VS05 but it never worked properly. Or at the very least, it never worked as well as VB6. Has that been fixed?

    – General IDE speed for all versions of VS was horrible. There were thousands of complaints about it. Is the IDE speed (when typing) at least as fast as VB6?

    – Is it possible to specify what upgrade warnings are inserted into your code when you migrate? That was a heavily requested migration tool feature. Everyone hated the thousands of lines of additional comments added to our code.

    – Where are our control arrays?

    – Has the execution speed been improved? Executables created with VS05 never ran as fast as those created with VB6.

    Reply
  16. dH

    I’ve only just moved to VB2008 and it’s very different to VB6 but it doesn’t take long to get to grips with.

    I had heard such bad things about VB.net that I’d stayed with VB6. I even toyed with RealBasic for a while but that really isn’t good, it claims to be the real follow on from VB6 but it isn’t. It also claims to have almost the same syntax but found it quite a pain and gave up before the pitiful 30 day trial had ended.

    Good to see the serial port back in VB2008 and the return of shape type controls, with ovalshape and rectangleshape. They are just little things that make my life easier. I don’t like not having the Form Layout window as in VB6, it’s not a major issue but was time saving feature.

    I think it’s best to treat VB2008 as a long lost relation of VB6 rather than a direct descendant.

    On the negative side it does crash a little too much, this is putting off using it on any applications where down time is important which is 90% of them.

    Reply
  17. Ming

    The problem with VB.Net is that Microsoft wants to make a VC++ version of VB6. Don’t try to make VB to do ANYTHING.

    Will you drive a Formular 1 racing car to do daily shopping?

    Reply
  18. Ming

    For the VS.NET IDE speed issue, I think it mainly because MS wants to make ONE-FIT-ALL IDE but the reality is we NEVER SEE ANY ONE-FIT-ALL idea works.

    That’s why we drive car, ute, truck, 4X4, motor bike and etc.

    That’s why we flight BlackHawk, Boeing 747, 777, 787, Skybus and etc.

    That’s why we eat Bread, Noodle, Rice, Pizza, and etc.

    Reply
  19. Celia

    I so agree with Davids list of VB.Net negatives. Any answers anyone? Will vb6 to vb8 code converisons be relatively painless?? (unlike vb6 to vb.net which is just not worth doing)

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *