The first is the need to update live Visual Basic 6 applications without further complicating the code base. The second is the need to work with that VB 6 code base in a VB .NET world. The third is the inevitable need to leave Visual Basic 6 behind, either for Visual Basic 2005 or the upcoming Visual Basic 9.
In a recent chat with SearchVB.com, Michael O'Neill, a Visual Basic product manager, provided some details on Microsoft's efforts to address all three realities.
IntelliSense, LINQ ease the transition to Visual Basic 9
Visual Basic 9's new features are touted as both productivity enhancements and better functionality. By both coincidence and design, these features assist developers well-versed in VB 6 but new to .NET, O'Neill said.
The extension of IntelliSense, for example, offers obvious benefits to new developers. "You hit return, IntelliSense is going to pop up," O'Neill said. "There's a lot in there, so this shows you all your options. You don't have to remember how; you can focus on the what."
The Language Integrated Query, or LINQ, also appeals to the Visual Basic 6 developer. This is not only because of its obvious ties to database programming but also because it makes SQL and XML an integrated part of development, O'Neill said.
With Visual Basic 6, and even with VB 2005, interacting with a SQL string can be a tad troublesome. "The compiler has no knowledge of what's in that string, so you don't find out if you've made a mistake until you're debugging," O'Neill noted. "VB 9.0 and C# 3.0 understand that statement just as if it's a regular expression. When you think of a VB 6 developer who's totally new to VB on the .NET Framework….having one less thing that you have to test for at debug time, it's that much more [helpful]."
Migrating that code, finally, to VB .NET
Though Microsoft is still supporting the Visual Basic 6 runtime in Windows Vista -- more on that below -- the company nonetheless encourages VB developers to work in VB .NET. (Developers looking for VB 6 to VB .NET migration strategies should read Getting started: Tips for VB6 to VB .NET 2.0 migration and Another side of VB migration, both from SearchVB.com.)
Two reasons for keeping applications in Visual Basic 6 are the migration process itself and the loss of certain bits of functionality that can occur once an app is in the .NET Framework.
To ameliorate this Microsoft has put together a set of add-ins called Visual Basic 2005 Power Packs.
One set focuses on the printing of WinForms, which was quite easy in Visual Basic 6, not so much in VB .NET.
The other set, the Interop Forms Toolkit, allows VB .NET user interface forms and user controls to run in a Visual Basic 6 application. The benefit here, O'Neill said, is that it prevents the presence of a "forked code base" that includes a bit of VB 6 here and a bit of VB .NET there. "It looks like and operates just like it's part of a VB 6 app, and it lets developers do a form-by-form VB 6 migration," he added.
O'Neill said the Visual Basic group will continue to release "off-cycle power packs" for both VB 2005 and Visual Basic 9. As for what will be in these releases, O'Neill pointed developers to the site, accessible from the VB 2005 Power Packs page, where suggestions can be made and voted upon. "We'll try to focus on what the community wants us to focus on," he said.
Programming Visual Basic 6 in Windows Vista
Microsoft recognizes that many, many enterprises and developers have significant Visual Basic 6 investments that have yet to make the move to the .NET Framework.
As a result, O'Neill pointed out, not only do Windows Vista and the Windows Longhorn Server support the Visual Basic 6 runtime, Windows Vista also supports the VB 6 IDE.
"We spent a lot of testing the IDE with Vista, making sure that it works. It's an extraordinarily stable development environment," O'Neill said, adding that it has been quite a while since the Visual Basic group has had to fix a bug.
By bringing the Visual Basic 6 runtime into Windows Vista, mainstream support for the runtime is assured until 2012 and extended support is available until 2017. "There's a long window for settling your VB code," O'Neill said.
Microsoft's Support Statement for Visual Basic 6.0 on Windows Vista indicates that the Visual Basic 6.0 IDE is still slated to move out of extended support in April 2008.