MICROSOFT VISUAL BASIC PROGRAMMING
Why Visual Basic.Net?
Here is a series of questions
that provide a background to Visual Basic.Net. The answers highlight the problems
and opportunities facing the Visual Basic programmer in using the brand new Visual
Basic.Net.
How different is VB.Net?
VB.Net is a complete rewrite of Visual Basic 6. The syntax is still almost
"Visual Basic" as we know it, but everything else has changed. It now has all the
functionality of "C", "C++" or "C#".
VB.Net is not VB6 with some enhancements. It is a completely different Object
Oriented language incorporating Encapsulation, Inheritance and Polymorphism. Compatibility
with VB6 has been well and truly broken.
Is VB.Net easy to learn?
Visual Studio.Net incorporates Web projects and Web Services, new areas that
need specialisation. ADO.NET is not simply a new Version of ADO, but a complete
rewrite. VB.Net Deployment now uses Microsoft Windows Installer – more
powerful, but completely different to VB6 Deployment. The new printing facility
of VB.Net provides enormous power with its functionality, but the simplicity
of VB6 has been lost.
The latest release, Visual Studio 2008 has even more features. There is now AJAX,
LINQ, WPF, JavaScript, CSS IntelliSence, etc, etc to learn. Together with Object
Orientation, all these aspects involve a huge learning curve.
It is difficult for the Visual Basic Programming neophyte to learn – especially
as VB.Net is so vast and is evolving so rapidly.
The Help system is shockingly bad. There are now some VB.Net examples, instead of
only C# examples – but C# is dominant. There is still too much that is at
a low-level and esoteric. Defining how a procedure gets Overloaded in 40 different
ways is not my idea of documentation.
Thankfully, there is a very active VB.Net community. The Internet is beginning to
become a source of information on Visual Basic.Net. The trouble is trying to work
out what is current and what has been superseded. Most books on Visual Basic.Net
are half-baked, and rushed out to print too quickly.
Is VB.Net stable enough to use?
The current Version (Visual Basic 2008) is a huge improvement over the previous
release. VB.Net produces code that is stable and is completely acceptable.
The IDE still needs to be made more efficient. AJAX and Silverlight are immature.
How helpful is the VB.Net Upgrade Wizard?
- It does not ensure a 100% upgrade.
- Its output will "sort of" run. But you need to resolve a multitude of Upgrade problems.
- It uses a code standard that is difficult to maintain. Control arrays are now handled,
but the code is difficult to support.
- Some of the "fixes" of the Wizard are esoteric and non-maintainable. The "< ...
>" construct may work, but is difficult to maintain.
- The Upgrade uses the old VB6 controls, with massive amounts of warnings on potential
problems, differing Events and Methods.
- The conversion of Resizing functions work, but is difficult to maintain. Using the
new Anchor/Docking involves a redesign of the Form.
- The Upgrade Wizard is a poor learning aid – it does not produce up-to-date
examples.
- Upgrades of the VB6 APIs are messy, and not recommended. There is always a VB.Net
alternative.
- The conversion will be problematic for any system of non-simplistic size. The Upgrade
Wizard produces code that involves a lot of cleanup work.
To get a "clean" version of the code, it is necessary to start a new project from
scratch, and use the minimum of the "converted" code.
What about Data Grids?
Microsoft's DataGrid has all the functionality of the third-party software. It is
just as easy to use, if not easier.
- It is free!
- It has an unbound mode. This allows the programmer more control than the bound mode.
- It is easy to create a class encapsulating the control's Object Orientated logic
(which is rather esoteric) into simple properties and procedures.
- Microsoft's documentation on the DataGrid is dreadful (as usual), but the Web is
now a great source of information.
- The Style of each column can be readily set.
- Font and Colours can be changed – however the standard Grid layout is appealing.
Is it necessary to convert to ADO.Net?
No, it is not essential to convert to ADO.Net – all the old ADO routines are
still available. ADO converts reasonably easily in VB.Net. You should consider
the migration to ADO.Net when there is an efficiency problem. That is when:
- There are many opens and closes of a database.
- Disconnected database access is required for a Web site.
- There are heterogeneous sources of data.
- There is heavy database activity.
Otherwise, you can keep using the classic ADO routines that you know and love.
|