Why .net?

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Hello,

I work for a firm which develops some very complex vb6/sql
server programs - all our code is ado/stored procedures
etc including crystal reports. I've tried converting some
programs to .net but the upgrade wizard for one of our
programs took 8 hours to get about 20% done, so I gave up.

My question is this: given that upgrading is so hard, why
do it? But more impotantly, why use .net? I know that'll
be a silly question but ado.net seems more complex
(datasets) and we can make our apps run on the web through
citrix. Why should we program our new systems in .net
apart from keeping up to date? Can anybody give me a list
of reasons why it would be worthwhile learning a new
language?

Thanks,

Mike
 
Mike,

First of all, if you want to upgrade your project to dotnet, forget about
the upgrade wizard. While it may convert your projects, it will not change
their design. You will end up with a program that is designed for VB6 and
does not take advantage of any of the new features of .net (free threading,
windows forms, full object-orientation etc.). You can of course use .net and
VB6 side by side through COM interop.

I'll try and give a quick answer to your questions:
given that upgrading is so hard, why
do it?
Don't feel that you have to upgrade. In my opinion, upgrading should mean a
redesign and rewrite to do properly (if you want to get the best from .net).
Making the decision to upgrade should be made from a business point of
view - do you have the time to invest in upgrading?; is there a big enough
demand to justify the staff training in .net?

If your project is big, and you really don't want to redesign the whole
thing, but still want to make the move to .net, then consider writing new
components in .net and accessing them through COM interop.

Why should we program our new systems in .net
apart from keeping up to date?

Because the feature set of .net is much bigger than that of VB6 and it could
simplify your design and make new development much easier. .net gives you
access to features that were hard to do under vb6 (threading, network
communications, windows services etc. etc.). This said though, if VB6 meets
your requirements, then don't change simply because .net is new and shiny.

Hope this helps. Maybe someone else can give you a better point of view.

Trev.
 
Hey Mike,

Understandable on the vb6/sql upgrade issues. IMHO, if you are comfortable
with your VB6/sql programming and it works for you, then stick with it.

..NET does offer some nice features such as object inheritance which is
REALLY useful on forms (the one feature I wanted most in VB6). Not only
that, but there are a bunch of other little fun things about it that make it
nice. I think the biggest thing is visible code completion/serialization.
Objects are much easier to build and require a lot less work by integrating
with the IDE.

ADO.NET is complex, but in fact, it is incredilby similar to ADO 2.5+, just
exposes more of the properties. RecordSet is now DataSet, Connection just
has more enumerations and possiblities, and recordsets[dataset] are now
strongly typed.

The big advantages I see are the incredibly simple and visual interface that
makes developing applications faster because it does a lot of the "boring"
work for you. OR at least what 90%+ of developers would need.

Not only that, but a lot of functionality is now automated or requires less
work (such as common calls to the Win32API). This is just to name a few of
the thousands of advantages.

But if your comfortable, I say move slowly, why fix what already works.

-CJ
 
Mike,
To me the biggest reason to go .NET is Full OOP! Next would be the very rich
Framework (which is still growing, as evidence in what has been announced
for .NET 2.0 due out later next year). These two items combined, empower
your developers to be more productive. Of course there is a training &
desire issue to learn the OOP & the Framework.

In contrast to what Codemonkey stated, I find using the Upgrade Wizard can
be beneficial! The Upgrade Wizard in VS.NET 2003 seems to behave & work
better then the one in VS.NET 2002.

I have used the upgrade wizard on a couple substantial projects, then using
Refactoring http://www.refactoring.com have slowly modified the upgraded
project into more OOP & .NET designs.

Although I agree with Codemonkey, depending on the quality of the code, your
skills at OOP and your skills at Refactoring using the Upgrade Wizard may be
more pain then gain.

Also using the Visual Basic 6.0 Code Advisor, on your VB6 project, before
you attempt to use the Upgrade Advisor:

http://msdn.microsoft.com/vbasic/downloads/codeadvisor/default.aspx

Will allow you to modify your VB6 project, so that the upgrade wizard does a
better job of upgrading it.

Hope this helps
Jay
 
I didn't mean to be harsh on the upgrade wizard - I just haven't bothered
with it since I tried (and failed miserably) to upgrade my own (messy and
badly written) VB6 app.

Besides, why miss out on all the fun of getting the chance to redesign and
rewrite something from scratch ;)

Cheers for the tips about Refactoring and the upgrade advisor. I shall take
note for future reference!

Trev.
 
Trev,
To me the Upgrade Wizard is one of those mixed blessings, when it "works"
its great, when it doesn't it doesn't! So I was trying not to imply your
statement is wrong! My comment was more of a sometimes it is useful.

By "works" I do not mean literally it ran, I mean it upgraded your project
so, the project runs as a VB.NET app. For example if you have "messy and
badly written" VB6 code, I would not expect the Upgrade wizard to be very
useful. I converted an app that is "messy and badly written", and it took
about a week to get it to run on VB.NET, this partially due to its size and
partially due to do the code quality (or lack there of) of the VB6 code.
Which is where the VB6 Code advisor would have been useful first, I would
have spent a week in VB6 to get the code quality a little higher. ;-)

I think it also depends on how "modular" your code is. Do you have a single
EXE that contains all the logic, or did you segregate your app into
reasonable sized class libraries. As with reasonable sized class libraries,
you can convert individual class libraries easier then converting the entire
app in one fell swoop...

Hope this helps
Jay
 
Hi Mike,

Lots of reason to begin developing in .net, but I'll mention just one that
hasn't been mentioned but will matter to you a great deal: ado .net
datasets store data in memory and do not access the server until updates are
required. Imagine no table locking issues, no clashes, opening multiple
instances of the same table or join, etc.

It goes well beyond this - especially for sql server, there's a direct
provider that accesses sql faster than ado - any version. Learning the
object model is not as simple as you might suppose, but it wonderful
features once learned.

HTH,

Bernie Yaeger
 
Jay, thanks for the help. Next time I come accross some dodgy VB6 code of
mine, I'll give the UG wizard a bit more time and respect.

I still say it takes the "fun" out of rewriting from scratch :P
 
Back
Top