Crossroads for VB6 Users

Which path to take? Migrate applications to .Net, or replace, rewrite or just reuse them? The best choice often depends on the quality of your VB6 code and the experience of your staff.

Christopher Pesola was so eager to see how well the upgrade wizard Microsoft Corp. supplied would migrate Visual Basic 6 applications to its new .Net development environment that he tried a beta release in early 2002.

Pesola, associate director of application services at Learning Care Group Inc., would eventually learn that the tool could convert 75% to 80% of the VB6 code in the Novi, Mich.-based company's lightweight applications -- those with fewer than 1,500 lines of code. But it would fare much worse with the major VB6 application that its 470 day-care centers use to run their operations, migrating just 20% of the code.

"That just wasn't worth it for us," Pesola says.

Increasing numbers of IT shops are confronting the decision of whether to modernize their aging VB6 code. In some cases, that's because Microsoft ended the free mainstream-support phase for its VB6 tool as of March 31. Over 7,000 people -- including more than 250 Most Valuable Professionals that Microsoft has honored for their contributions to technical communities -- have signed an online petition since March to urge Microsoft to continue to support, develop and update the core VB language.

The uproar, at least in part, stems from the substantial changes between the old and new VB development environments. VB.Net makes use of a different runtime, different class libraries and a different object model. And developers often face a moderate-to-steep learning curve to master the .Net Framework and shift to the object-oriented programming model that will enable them to reap the full benefits of the new environment.

Microsoft has shown no signs of caving to the demands of the protesters, maintaining that they represent a minority of the millions of VB developers. More users prefer the new tools, especially for building Web-based applications, the company says. Nonetheless, Microsoft has pledged to improve its migration tools and the interoperability between VB6 and VB.Net, which will be called VB 2005 with the next release, due in November.

Companies will continue to weigh their various options in the interim. They can run their VB6 applications until they lose their usefulness. They can use the .Net upgrade wizard and rewrite code that does not automatically convert. They can migrate parts of an application to .Net and leave parts in VB6. They can rewrite an application in VB.Net or another language, such as C# or Java. Or they can replace it.

Microsoft says an IT shop is likely to try each of those approaches at one time or another, with the decision largely dependent on the quality of the VB6 code and the application's business value.

Learning Care Group tried Microsoft's code adviser and upgrade wizard with all six of its VB6 applications. The tools analyzed the code line by line, changed the portions that it could migrate to .Net and flagged the portions that it couldn't migrate, Pesola says. The company then had the option of rewriting the problem parts in VB6 and trying the wizard again, or rewriting them in .Net.

Pesola chose to rewrite portions of a small customer service call-logging application and spent about five days developing, deploying and testing it. But that was the only time Learning Care chose that migration route. The company replaced two VB6 applications with packaged software. It's looking for a better option for an application used by its finance group. And it realized that one VB6 application was no longer used very much and decided to leave it running as is.

For its largest day-care center management application, Learning Care put out a request for proposals after finding that only 10% to 20% of the code would convert. Pesola says he tried through rewrites to boost the number to 50%. But when he got to about 25%, he realized that it wasn't worth the effort because of the application's functionality limitations. Learning Care paid about $1 million for a newly architected .Net-based application from NuSoft Solutions Inc., a Microsoft Gold Certified Partner in Troy, Mich., and hopes to maintain the application on its own within the next year or two, Pesola says.

The decision-making process will be far more involved for A.G. Edwards Inc. The St. Louis-based brokerage has about 700 VB6 applications, and so far it has migrated only about a half-dozen to either Java or VB.Net, according to David Strickland, the company's enterprise portfolio architect.

Strickland says he can't see the point of tweaking VB6 applications merely to get them to run on the .Net Framework. He wants the company to convert its client/server applications to well-architected multitier applications that can better take advantage of .Net's new capabilities.

Since 65% of A.G. Edwards' 190 programmers work in VB6, shifting developers to the new environment will be just as critical as moving the applications. The company is setting up a competency center to help its developers get up to speed not only on the .Net Framework but also on a new language. Strickland views Microsoft's C# language as a better strategic choice than VB.Net, since from a syntax perspective, it's more similar to Java, the language the rest of the company's developers use. "If I move to C#, the VB guys can get there easier because the platform's kind of the same. They're used to the tool set," he says. "And the Java guys can get there fairly easily because the syntax is the same."

A.G. Edwards recognizes that it will likely have to do lots of new coding to replace its old VB6 applications. The company is also exploring the possibility of bringing in a vendor to help with a "double hop," migrating first to VB.Net and then to C#, Strickland says. Other VB6 applications likely will be decommissioned or replaced with packages, he adds.

With typical client/server applications, "where everything's entangled," the choice is often to leave the application alone or replace it, says Carl Zetie, an analyst at Forrester Research Inc. But an IT shop has a good chance of extracting usable interfaces with a well-architected VB6 application that has presentation, business logic and database layers.

That's the situation Berkshire Life Insurance Company of America found itself in with its three-tier disability income insurance claims system. The Pittsfield, Mass.-based subsidiary of The Guardian Life Insurance Company of America could migrate its VB6 application a layer at a time, leaving pieces in VB6 when there was no compelling business reason to upgrade to .Net.

Developers started at the back end, rewriting the data access layer in C# and ADO.Net, a shift that helped to improve the data access performance by about 20%, according to Tim Murray, a systems analyst. Developers also found themselves more productive in the new environment, because the .Net Framework handles more of the plumbing code.

Berkshire Life is now in the process of migrating the presentation layer to .Net, but developers left the business logic in VB6 because they saw no benefit to migrating more than 100,000 lines of business logic "that basically works," says Bill Chandler, second vice president of corporate systems at Berkshire Life.

"Nothing in .Net would change the way we wrote those rules," says Murray.

.Net's Component Object Model (COM) Interop feature enables the team to maintain references to the old VB6 Dynamic Link Libraries. The company encountered "DLL hell" when the application couldn't find the old libraries it needed in only a few cases with third-party DLLs. To work around the problem, they put VB6 wrappers around those DLLs, says Murray.

"Overall, we've had a very positive experience with .Net and its interoperability with VB6," says Scott Dougherty, another systems analyst at Berkshire Life.

Jackie Goldstein, principal at Renaissance Computer Systems Ltd., a Hashmonaim, Israel-based member of Microsoft's Regional Director program, says he has had "ridiculous conversations" with clients who have asked him to help them come up with a plan to migrate millions of lines of code. He tells them that's not what they should be doing. Wrappers that are automatically generated for existing COM DLLs work fine in most cases, and only occasionally do they require "a little fix-up work" or an adapter, he says.

"When migrating, rewriting or converting, there's no silver bullet," Goldstein says. "Before you worry about migrating lines of code, you should spend time thinking about the architecture. You want to do it incrementally."

Billy Hollis, a Regional Director program member who owns Next Version Systems, a consultancy in Nashville, says a thorough code review is critical for any company moving to .Net. He says the tendency of VB6 developers is to write code to fix a problem. But they need to learn to write less code and let the .Net Framework do the work for them.

"You might spend three hours to research the framework and find something that does 90% to 100% of what you want," Hollis says. "Or you might have to extend the framework, but that's typically more efficient and effective than writing code from scratch."

Copyright © 2005 IDG Communications, Inc.

7 inconvenient truths about the hybrid work trend
Shop Tech Products at Amazon