VERY Newbie - managing classes

  • Thread starter Thread starter aaj
  • Start date Start date
A

aaj

Hi all

I'm making the jump at last and moving from VB6 to VB.NET. I have written my
first few classes and things seem to be working. I have a few questions and
wonder if anyone can offer some advice. This is my first attempt at anything
object orientated, so please forgive me if my questions are naive or just
dont make sense.

The main thing I need to get to grips with is managing classes.

Typical thoughts go along the lines of -

If you have instances of classes that interact with other instances, how do
you keep track. In the example I've been learning with, I have a class that
holds collection of employee names, and then each employee name is of a
class 'fullname'. Its easy enough to manage these few lines of code, but I
can imagine it could get messy once the projects grow.

Once I got it working, I went back through with a pen and paper and drew out
how the bits fitted together. That lead me to think does Visual studio have
a graphical representation of how everything interacts, is there some
software I need to analise a project, are there better ways to do this?

thanks in advance

Andy
 
Hi Andy,

..Net is nothing but classes referencing eachother and there isn't any
mess. It just requires you think in a slightly different way ("everything
is an object").

Visual Studio does however have class viewers to help you manage large
projects, and Visual Studio 2005 will have even more of that, a class
diagram to visualize your class layout.
 
aaj said:
Hi all

I'm making the jump at last and moving from VB6 to VB.NET. I have written my
first few classes and things seem to be working. I have a few questions and
wonder if anyone can offer some advice. This is my first attempt at anything
object orientated, so please forgive me if my questions are naive or just
dont make sense.

The main thing I need to get to grips with is managing classes.

Typical thoughts go along the lines of -

If you have instances of classes that interact with other instances, how do
you keep track. In the example I've been learning with, I have a class that
holds collection of employee names, and then each employee name is of a
class 'fullname'. Its easy enough to manage these few lines of code, but I
can imagine it could get messy once the projects grow.

Once I got it working, I went back through with a pen and paper and drew out
how the bits fitted together. That lead me to think does Visual studio have
a graphical representation of how everything interacts, is there some
software I need to analise a project, are there better ways to do this?

thanks in advance

Andy
Hi Andy,

I recommend to switch to C# instead of VB.NET.
Petr
 
I made this same adjustment. Once I got used to the .NET object..... THEN
I switched to C#. Get used to the way the .NET evironment works, then step
up to C#.
 
Thanks for the answers so far chaps...

whats the advantage of c#? from reading all the sales literature, I was
under impression that the common language runtime eliminated the
differences, so VB.net would do pretty much the same as any other .net
language. I'm definitely prepared to make a jump if its going to be worth
it.

I have experience (from many years ago) in C, but not C++ so again, I'm very
new to this OOL world. Is it difficult to move to c#, do we still use
pointers and references?

The reason I liked VB6 was I found it very easy and fast to develop small
utilities and aps.

thanks again

Andy
 
The main difference between VB.Net and C# is the Syntax.

C# uses a C style syntax with { } to keep track of code blocks and ; to
mark end of code line.

C# uses the exact same way of referencing .net classes as VB.Net (with a
few exceptions like indexers) and do not use pointers like C/C++. Events
are also handled differently than in VB.Net.

However, a few things that you can do in VB.Net cannot be done in C# or at
least not straight forward.
On the other hand, C# allows you do step out of managed code and handle
memory directly using the 'unsafe' keyword, and a few other things in C#
are not availble in VB.Net

In the end VB.Net and C# are considered equal with neither being better
than the other.

Personally I prefer C# and find it more readable while VB seems to be 'too
full of unecessary words'.
 
On the other hand, C# allows you do step out of managed code and handle
memory directly using the 'unsafe' keyword, and a few other things in C#
are not availble in VB.Net

Slight clarification: unsafe code in C# is still managed. It's just not
quite as rigorously checked for type and memory safety as safe code.
 
Back
Top