Visual Basic (VB) is a force to be reckoned with. Single-handedly, it shifted ownership of Windows development from crazed gurus reciting the hundreds of Windows API (application programming interface) calls in their sleep to a broad range of professionals. With version 3, VB became a star. There were problems when an application got large, but for most uses Visual Basic was a superb tool.
Version 4 was not so convincing. While it had much going for it, with an improved development environment, class modules, support for 32-bit and more, VB4 didn't really catch on. This was because the code was much slower to initialise than its predecessor and VB4 had lost its innocent ease. With impressive competition from Borland's Delphi rapid application development (RAD) tools, it seemed that VB was teetering on the brink.
Now VB5 has arrived, and it's good news for almost every RAD developer, unless you want to develop 16-bit applications, which aren't supported.
VB5 arrives in a confusing mix of versions: "learning edition", "professional edition" and "enterprise edition". For commercial development you can forget the first, so the choice is whether or not to plump for the enterprise extras (see box). To add to the confusion, Visual Basic can be bought separately, or as part of the monster development tools suite called Visual Studio 97, where VB is accompanied by FoxPro, C++, J , Visual Interdev and more.
It's in this attractive company that VB provides one disappointment.
In the past, Microsoft has shown promise in providing a standard development framework, Developer Studio. This is a familiar environment whichever tool you are using, transparently combining development with on-line information.
Although VB5 looks a bit like Developer Studio, it isn't part of the family.
The development environment is much changed, though. Gone are the skeletal toolbar and floating windows (though you can drop back to them if you like). Now VB is a container with its prime windows distributed around the edge. In this mode,1,024x768 is a sensible minimum resolution for a development machine. The toolbox is more flexible, with user defined tabs. You can also have more than one project open at a time, each within a separate window, which is valuable if you are developing components, making it easy to plug them into a testbed.
Those familiar with Visual Basic for Applications (VBA) in Office 97 will recognise a host of additions that make life easier for developers.
There are lots of little things to improve the way you work: parameters and code syntax are flagged up as you go; keywords are filled in; code can be "commented out" at the click of a button. It's also worth noting that there's a new form style. Along with Windows-style SDI (Single Document Interface) or MDI (Multiple Document Interface) available in previous versions of VB, you can now choose an Explorer form for navigating or browsing documents.
Since the beginnings of Visual Basic, there have been mutterings about the slowness of partly compiled p-code, the format use in VB applications.
P-code is interpreted by the VB engine, in a similar way to the way Java applets run in the Java Virtual Machine. But this has now changed in VB5.
There is now an option to produce native compiled code, using the Visual C++ back end. The code produced no longer requires the VB engine. As a result of this, coupled with pepped-up data access and some nifty work on form rendering, applications move significantly faster than with VB4.
Less encouraging is the run-time file which is needed even with natively compiled code. This has grown to a whopping 1.27Mb. The EXE for my test database has similarly expanded from 153Kb (in VB3) through 292Kb (VB4) to 447Kb (VB5). If you need an application to run from floppy, stick to VB3.
The most trumpeted feature of VB5 is the ability to produce ActiveX controls, the components formerly known as OCX. Since version 4 it has been possible to generate OCX DLLs. Now you can knock up a true control that can be popped into the Visual Basic toolbox or feature on a Web page.
Producing an ActiveX control is painless and quick. Through ActiveX it is possible to put together a clean, separate control with a properly identified interface. This is a step in the right direction for code reuse in Visual Basic. Microsoft has also ensured that ActiveX controls can be used on the Web. Less well publicised, but equally interesting to the intranet developer, are ActiveX documents. Each document is, in effect, a Visual Basic form, but one that can be activated via a browser or the Office Binder. It is even possible to have a set of ActiveX documents connected by hyperlinks, acting like a full scale Visual Basic application.
There are also more wizards to help the developer. Beginners will welcome the Application Wizard which builds a simple program framework, while the more experienced will benefit from wizards that help with the public interface of an ActiveX control, or migrate a VB application to a set of ActiveX documents. I particularly liked a feature to "roll your own" wizard. Wizards are one of the more significant developments in the graphical user interface, but up to now VB developers had to hack something crudely.
The wizard manager generates a wizard, by default as a DLL (Dynamic Link Library), ready for you to fill in the text, pictures and actions.
Visual Basic programmers have often been irritated by not being able to make use of callbacks, in order to provide sensible feedback during a lengthy process. There were third-party components to do this, but by default they did not support asynchronous callback. Callbacks are now an integral part of VB. By adding new events, you can provide other parts of your code with appropriate information as a process proceeds.
Object freaks will also be glad to know that that most obscure of terms, polymorphism, is now supported. This makes it easy to plug in related classes to a routine, because the same property or method can be supported across a range of them. It makes for more flexible code.
But before object lovers raise a resounding three cheers, it ought to be pointed out that Microsoft has still avoided implementing inheritance.
This is the mechanism that allows you to take an object and make a new one that inherits its properties and methods. Instead, Microsoft has used the Common Object Model (COM) to support polymorphism, which will almost certainly raise purist's eyebrows.
The enterprise edition adds the familiar extensions for constructing three-tier applications, but there's more. A local version of SQL Server helps with developments hitting the back-end server, while a stored procedure debugger checks SQL before it's pumped up the line. An addition to the three-tier armoury is Transaction Server, a transaction and object management system to minimise the effort of developing distributed applications.
With an eye to the future, there's also a repository to store components, documentation and information about a development. This is an open database which can be manipulated directly, or used via appropriate CASE tools.
For the developer of 32-bit Windows applications for Windows 95/NT, VB5 is a real advance. The ability to construct ActiveX components will be popular both for livening up Web pages and for constructing easily reusable code. Speed and development environment enhancements are equally welcome.
While it's true that inheritance would be attractive, object support is yet again improved. Delphi may still have the edge for large projects, but VB5 has brought Microsoft close enough to be a worthy challenger.
VB remains the RAD environment of choice for easy, lightning-quick development.
And don't forget the attractive prospect of code compatibility across the Office suite. VB5 restores Visual Basic's credentials.
Contact and product information:
Visual Basic 5 is available from Microsoft on 0345 002000, Web site www.microsoft.com.
Pricing is yet to be announced.
VERDICT: VISUAL BASIC 5 Pros
- Speed improvements
- ActiveX controls and documents
- Enhanced environment
- Office code compatibility
- Not Developer Studio
- Big files
- Inheritance missing.
And, yep, it'll run Android rather than RiscOS
US engineering giant's cost-cutting outsourcing plan is on the rocks, according to insiders
HP Envy X2 laptop only affordable if you've got loadsamoney
Counterfeit code-signing certificates enabling hackers to hide malware being sold by cyber criminals
Certificates can be used as part of layered obfuscation to evade detection by anti-virus software