Link to home
Start Free TrialLog in
Avatar of redundguy
redundguy

asked on

What's new in VB.NET?

I am a Visual Basic 6 developer, client-server applications. Can someone tell me what are the new things vb.net brings to developers?
Avatar of chandukb
chandukb

interesting topic, just taking a ride along :)

Chandu
Wow..... I think you'd get a shorter answer if you were to ask what hasn't changed....

That one's simple enough: the syntax is much the same.
But.

VB.NET is built on the .NET framework. As such it shares the so-called "Common Language Runtime" with every other .NET language.

As a result, the .NET languages no longer need to rely on COM in order for components written in one language to understand components written in another.

Not that .NET makes COM obsolete, it makes it optional.
Further. With .NET, VB has finally become completely worthy of the label "Object Oriented". VB.NET is fully OO.
Everything is done through the CLR and the .NET Framework. You can still design Forms in a way similar to how you used to in VB6. But beneath the bonnet everything's changed.

Everything that has to do with creating your form is now exposed as code, and run through the Framework. It gives you total flexibility.

Perhaps you've been playing around with some advanced API stuff in VB6? You can chuck most of that away now in .NET, as most of what you would possibly want to do with a Window is now fully supported through the Framework.

Sizing and re-sizing forms and repositioning controls has become a doddle (I'm glad to say that what M$ have implemented is *exactly* what I've always been suggesting to people who had problems with resizing forms in EE :o)
ASKER CERTIFIED SOLUTION
Avatar of caraf_g
caraf_g

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What's changed is that programs that were coded badly will break! :)

People who did not use good programming practices will have to clean up their code in order to complete the conversion.

Summary:
* undefined variables will change from being variants to being objects
* DAO and RDO are no longer fully supported, so upgrade to ADO ASAP
* all types double in size, so anything defined as Integer must be renamed as Short to maintain compatibility, and Long becomes Integer
* late-bound items will likely break in the conversion
* date fields defined as double will cause problems
* object default properties are no longer supported (i.e. "msgbox Text1" will generate an error; you must use "msgbox Text1.Text")
* booleans math will require new keywords (BitAnd, BitOr, BitNot, BitXor)
* -1 and True are no longer necessarily equal (i.e. True is boolean, -1 is integer)
* zero-based arrays are the only game in town (Dim x(10) creates an array of x(0)-x(9)!)
* Named constants should be used in place of values (use vbYes rather than 7 for messageboxes; etc.)
* Legacy features go away (DefInt, DefStr, ..., On Goto, On Gosub, Return, VarPtr, LSet, etc.)
* Shapes will go away and must be replaced with new functions
ping... :)
Avatar of Éric Moreau
Avatar of redundguy

ASKER

Thank you for answers, caraf_q and rspahitz.
Realy I don't know now what answer is better.
I'll decide until monday.

hope you will get more comments about it.
I've programmed with VB since version 1.0 (and BASIC before that).  I've been working with VB.NET since Beta 1 was released.  The two are very different!  When I first started with VB.NET I spent hours trying to do something that would have required seconds in VB6.  A big part of this is that the beta 1 documentation is pretty thin and also there are bugs in beta 1 that can make it difficult to know when the problem is your fault and when it is the system's.

There are many things that I like about VB.NET.  I especially like the structured error handling (Try, Catch , Finally).  ADO.NET is to ADO what ADO was to DAO, that is, they are used to accomplish similar things but the syntax is completely different.  The underlying concepts behind ADO.NET are also rather different compared to ADO and take some getting used to.  In addition they have already said that there will be some changes in the ADO.NET syntax in beta 2 (the DataSetCommand object will be called something else).

Visual Studio.NET has many really neat features.  So many that you don't really have room to use them all.  They've done some really clever things that allow you to pull in explorers, property lists, etc. as required from the sides of the screen.  I am using a system with two 21-inch monitors and I still don't have enough room to see everything I want to see.

VB.NET is very object oriented (if you aren't already programming with classes/objects you will be way behind).  Almost all of the data types have changed (no variants, no currency, integers are what used to be longs (4 bytes), etc.  All of this takes some getting used to.

Here is an example of how the syntax has changed.  In VB6 you can initialize a string with repeating characters like this:

Dim MyString as String
MyString = String$(5,"X")

MyString will then be "XXXXX".  in VB.NET you do it like this:

Dim MyString as string
MyString = New String("X"c, 5)

That may seem like a small difference but I spent hours trying to find how to do it (yes that "c" is required).

Forms and controls have changed a lot.  There are no control arrays (which I used a lot).  Many of the properties have changed (labels have a text property rather than a caption property for instance).  This isn't that big of a deal except that all your experience goes down the drain as you spend 10 minutes trying to set a label's caption property and can't find it.

The debugging facilities in Visual Studio .NET are super.  Almost everything has been improved dramatically (once again it takes time to get used to things like single stepping with F11 rather than F8).

Anyway I'm looking forward to the release of Beta 2 (MS has indicated that it will be available next week).

Gee, Joe_Griffith, a lot of what you describe sounds like Java in Visual Cafe (including F11)!  Maybe it won't be that hard for me :)
One thing I hate about VB.NET is that you have to have bracketed parameters in all calls, even subs. I guess I'll get used to it though; can't wait for visual inheritance.
Thank you Joe_Griffith too.
Thanks! :o)