|
-
Jun 16th, 2003, 10:57 AM
#1
Thread Starter
Fanatic Member
VB6, VB.NET, C++ or C# ???
Found this article.
What do you make of it?
I know it's a long article but the suggestions on the bottom are very interesting.
----------------------------------------------------------------------------------
VB is a language that had its own spirit and sensibility. It had an ethos for many programmers of getting the job done fast, even if we knew in our heart of hearts that our code was a bit of a hack. Time and again, VB just works, period.
Early samples from Microsoft showed us a new Visual Basic that did not look like at all like Visual Basic code. Well-respected VB gurus of the old school weighed in and pronounced that this new doppelganger wasn't VB at all, but a sort of futuristic, soulless ghost.
To Dot Net or Not to Dot Net, That is the Question...
As we have all heard, Visual Studio.NET was released with great fan-fare Microsoft. Now that we have a release version of the program, the choice which all managers have been dreading has reared it ugly head: Do we migrate our VB 6 applications to VB.NET? No article or person can tell you the answer to this question as it is extremely dependant upon your individual situation and must be assessed on a case by case basis. I am going to attempt to give you some of the benefits and drawbacks of moving to VB.NET from VB 6 and then the choice will be yours.
Due to the fact that the new .NET architecture is a major paradigm shift, this question is magnified beyond the migration from version 5 to version 6. Any code which is going to be migrated over needs to be thoroughly evaluated and regression tested before it is moved to a production environment. Due to the changes in the basic foundation of the VB language, bugs can slip into your code in the strangest places and cause unforeseen errors. Microsoft has attempted to alleviate the problems as much as possible by including a Code Migration Tool, but that is not a complete solution. Once the code has been processed using the Tool, every line of code must be re-examined by hand to ensure that the Tool converted the page properly and to clear up any lines the Tool marked as unable to convert.
BENEFITS OF VB.NET
There are many benefits and improvements incorporated in the VB.NET framework. The first benefit is the vastly improved memory and resource management. The resulting stability improvements are a significant reason to consider converting old code and writing all new applications on the framework. Secondly, is the ability to run VB.NET code on all operating systems in the future (ie. Linux, Macintosh, etc) and reduce or remove your dependence on the Windows operating system. Third, a VB.NET application can possibly gain significant performance improvements by implementing a multi-threaded design over the single threaded design of VB 6. Next, moving to VB.NET ensures continued support from Microsoft into the future. The fact of the matter is that Microsoft is going to stop supporting VB 6 sometime in the future. When that day comes, it will be a definite plus to have all the applications migrated over. To do that, it is necessary to start the process now, since it requires so much forethought and effort. Finally, by moving from VB 6 to VB.Net, it will be possible to leverage the existing skills of Visual Basic Programmers. The learning curve in moving from VB 6 to VB.NET is much less than moving to a new language such as C#.
DRAWBACKS:
Having mentioned the benefits, it is only appropriate to mention the downside of migrating all VB 6 applications to VB.NET. First, the learning curve for any existing VB programmers is going to be huge. Even though the learning curve is less than moving to another language, this is still a major shift in the language and most of the skills and expertise that VB programmers had in January became obsolete on February 13th, 2002. It is going to take a lot of time, training, and effort (read money) to get the entire set of VB programmers up to speed and able to start working on the new set of technologies. Second, once the programmers have ramped up their skill sets to be able to start the migration process, they will need to review and possibly re-code major sections of the application to work on the .Net framework. This will be a serious investment for an old application with a limited life span. Thirdly, if the application won’t benefit from a design change to make the application multi-threaded, it may actually suffer a performance loss. Finally, the .net framework runtime will need to be deployed to every machine which will be running the vb.net application. Until the framework is incorporated in the operating system installation, this will be an obstacle which needs to be crossed.
PREPARING VB6 CODE for VB.NET
The following suggestions are based on a Microsoft white paper on preparing your VB 6 code for VB.NET. If you make these changes to your VB 6, the migration wizard will do a better job of converting your code for use with VB.NET.
Declare all your variables
Instead of the Variant data type, use Object.
Instead of the Integer data type, use Short.
Use early-binding, not late-binding, when working with objects.
Use Date for storing dates, not Double as in VB 6.
Specify all properties for components and objects--don't use default properties as they aren't supported in VB.NET and will confuse the upgrade wizard.
In previous versions of VB, if a Null value was passed to some functions, they were guaranteed to return Null without generating errors. (This is called "null propagation".) It's not supported in VB.NET.
Use Zero Bound Arrays. VB.NET Arrays always start at 0 (just like C/C++/Java
Use Visual Basic constants rather than hard-coded numbers in your code.
Get rid of fixed-length strings as they are no longer supported in VB.NET
Windows API calls are still supported, but be aware that the data types may change (Integer to Short, etc.) in their prototypes:
For preparation for the VB.NET Windows Forms classes (instead of VB 6 Forms) for client-side user interfaces, remember that:
The OLE, Shape, and Line controls are no longer supported.
Don't use Form methods like Circle, CLS, PSet, Line, and Point. .NET offers new calls to do graphics. (You will need to re-write this code yourself.)
You can no longer print windows forms with Form.PrintForm.
You can no longer disable a Timer control by setting its Interval to 0. Instead, set its Enabled property to False.
Taking all these into consideration, all the applications your business uses need to be assessed for a cost-benefit analysis before deciding to undertake the migration to .NET. Although Microsoft will stop supporting VB 6 in the future, that time is currently far down the road and might not come before an application outlives its usefulness. For most applications, I believe that the costs will be high, but the benefits will far outweigh these in the end.
-
Jun 16th, 2003, 11:08 AM
#2
Declare all your variables
If anyone wasn't already doing this in VB5/6 they should have their keyboard access rights revoked
-
Jun 16th, 2003, 11:38 AM
#3
Monday Morning Lunatic
Option Explicit is your friend
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jun 16th, 2003, 02:47 PM
#4
Use Date for storing dates, not Double as in VB 6
-
Jun 16th, 2003, 02:53 PM
#5
Who the freak was storing Dates in doubles????????
-
Jun 16th, 2003, 03:04 PM
#6
Frenzied Member
Originally posted by Cander
Who the freak was storing Dates in doubles????????
The guy who wrote the article 
Z.
-
Jun 16th, 2003, 03:13 PM
#7
Thread Starter
Fanatic Member
The replys are very good. LOL
I'm just wondering if we should go on with VB6 or not.
And if not what to do, going to VB.NET or to C++ or C#.
The article was found somewhere by the guys with the very big banner in this forum.
-
Jun 16th, 2003, 04:28 PM
#8
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|