Visual Basic and code Maintainability
Code maintainability is the measure of the time, resources and expertise required to correct faults, improve performance, enhance functionality, or adapt to changing technology.
Maintainability is a concept that is almost always ignored when commissioning a new project. "How Much" and "How Long" are the only questions ever asked.
The code is never static – it always requires changing. Bug fixes, new functionality, inefficiencies and technology changes – will all require a code revisit.
Software development productivity and maintenance costs go hand in hand. Low maintenance costs are directly related to the effectiveness of the programmer.
The issue of code maintainability is first raised when the changes needed become costly. And all too often, even a simple change, is difficult to make. There is always a price to be paid for unmaintainable code – sooner or later.
The Fundamentals for Code Maintainability
Almost of all of this Website deals with the best practises for designing robust, efficient and maintainable systems. To be maintainable, the code must be:
- Well Documented
Here are some guidelines to achieve these aims:
The Programming Language
The choice of Software Development tools is an important factor in reducing the risk factor.
Selecting Visual Basic, the best and most popular programming language for commerce, ensures that a replacement programmer can be found without problem.
The logic of VB is simple and straight forward – essential factors for maintainability.
By using the Visual Basic programming language, the programmer has a head start – it will lead to simpler logic and lower maintenance costs.
Visual Basic.Net Coding Conventions
Coding standards must be set at the outset and enforced. The aim is to make coding for the programmer (or a replacement) as easy as possible.
Objects, Constants and Variables should adhere to a consistent naming convention. This will enhance program maintainability.
For details, see the pages:
Size really does matter: The larger each block of code, the more bugs and the harder it will be to maintain. Re-usable Code Libraries are essential in reducing code size.
Refactoring (See Why have Coding Standards?) must also be an integral part of the development and maintenance of a computer system.
Having a bookcase of documentation is not helpful.
But every complex aspect of the Visual Basic code must be documented, so that it is easy for a new programmer to be productive as quickly as possible.
And the function of every field in the database must be described and named according to an agreed standard.
Part of the standards should be to avoid unmaintainable, unmanageable code.
For example, only use Object-oriented programming (OOP) concepts that:
- Make programming simpler
- Improve software maintainability
- Provide faster development times and higher-quality software
And discard the OOP concepts that:
- Make the programming more complex
- Take too long to design and implement
Protect Yourself From The Outset
Don't assume that somehow your project will automatically and magically adhere to the best maintainability coding standards. Demand sight of the documentation on the coding standard used.
Have a professional programmer inspect a sample of the code. For example, do the variable names adequately denote their meaning? Are there sufficient inline comments? Is a library of procedures being used? Is the latest and best technology being used?
All this applies equally to a software house or to a solitary programmer.
Further suggestions that improve maintainability
Before starting any project, there must be a cohesive system of error detection and error reporting.
The quality of the programmers has a huge bearing on productivity and maintenance costs – hire only the brightest and the best.
A Library of well tested and re-usable procedures is essential.