MICROSOFT VISUAL BASIC PROGRAMMING
Why Visual Studio.Net?
Here is a series of questions that provide a background to Visual
Studio.Net. The answers highlight the problems and opportunities in using Visual
Studio.Net:-
What is Visual Studio.Net?
Visual Studio.Net lets developers adopt a unified programming paradigm, regardless
of the language chosen. The IDE (Integrated Development Environment) now includes
Visual Basic, ASP.Net, Visual C#, Visual C++, Visual J#, Web Services, Web Control
Library, Console Applications, Windows Services. All are in the Visual Studio.Net
package.
Will Visual Studio.Net ever take off?
Will it ever! It has a surprisingly high rate of adoption. Microsoft is concentrating
a huge effort to make the product system/market dominant. Visual Studio.Net
is the strategic direction of all future Windows software development. From Windows
Server 2003 on, the operating systems will be using more and more of the new technology.
Why is Microsoft pushing this new technology so hard?
Windows has been constantly evolving, and the old Operating Systems use the techniques
of the last century. The technology behind Visual Studio.Net required a complete
rewrite of Windows – fixing all known problems and using the best of development
techniques. All the cumbersome routines created higgledy-piggledy over the years
have been replaced by a cohesive system of Object Oriented routines. All the new
Windows operating system releases will be geared to the new technology.
This is not a minor project. It does not just involve programming language changes.
The big feature is "Managed Code" – which will eliminate Memory leakage and
the corruption problems which have plagued Windows from inception. The new technology
will cater for 64 bits – allowing bigger and better storage, databases, etc.
All security will be dependent upon it. The .Net Framework (code Libraries) will
be included in each new Windows Operating System, making deployment easier and smaller.
Are there any other reasons to adopt the new technology?
The new buzz words are Inheritance and Object Oriented programming. There are productivity
gains for programmers. Rich Class Libraries make programming easier. XML is handy
for transferring data between heterogeneous systems. There are now consistent APIs.
Self contained deployment packages, elimination of DLL hell, no registration –
make for easier deployment. ADO.Net now has Disconnected Recordsets –
essential for Web database access, and faster than the old ADO. Multi-threading
is an appealing feature – this allows background processing, while the user
continues working. There is better error handling.
A word of caution from Microsoft about Object Oriented programming :
"Visual Basic provides polymorphism through inheritance. This is a powerful mechanism
for small-scale development tasks, but has generally proven to be problematic for
large-scale systems. An over-emphasis on inheritance-driven polymorphism typically
results in a massive shift of resources from coding to designing, which does nothing
to shorten overall development time. Given that the real test of software is whether
it works for end users, tools for rapid prototyping and rapid application development
(RAD) have gained wider acceptance than tools for object-oriented programming."
What standards should be adopted when using Visual Basic.Net?
As Visual Basic.Net is changing so rapidly, it is best to adopt a very conservative
approach to Visual Basic programming. It is important to ensure the code is easily
maintainable.
Here are some rules that I believe should be adhered to:
- Despite Visual Basic.Net providing Object Oriented programming features, most Visual
Basic projects will have no requirement for OOP. It is recommended that, besides
the need for encapsulation that Classes and Modules provide, the Object Oriented
features be used only when there is absolutely no other alternative.
- Until Visual Basic.Net matures, it is recommended that all its esoteric features
be avoided.
- It is recommended that the older Format, Mid, Left, Right, etc be used instead of
the newer String handling features.
- Use the old Debug.Print – easier to remember compared to System.Diagnostics.Debug.WriteLine.
- MsgBox can be replaced by MessageBox.Show with its new features.
These rules will result in a coding which is easy to read, easy to understand, and
consequently, easy to maintain.
|