|
-
Jan 16th, 2006, 02:35 PM
#1
Re: What is the point of a class?
 Originally Posted by Pino
If you move to the dark side (.Net) you will see that classes become much much more useable, Vb 6 was week when it came to clases they were pretty slow if I remmber correctly.
Classes are awsome, for orginising code etc!
@Pino,
Please do not start another religious war - there is one already in VB.Net forum. Your current answer shows your weekness. Sorry.
-
Jan 16th, 2006, 02:37 PM
#2
Re: What is the point of a class?
 Originally Posted by RhinoBull
@Pino,
Please do not start another religious war - there is one already in VB.Net forum. Your current answer shows your weekness. Sorry.
@Rhino,
Is it not true that classes in vb6 are slow?
-
Jan 16th, 2006, 02:41 PM
#3
Re: What is the point of a class?
They are even slower in .Net so please I insist that if you want to continue arguments then do not mention VB.Net anymore.
-
Jan 16th, 2006, 02:56 PM
#4
Re: What is the point of a class?
 Originally Posted by RhinoBull
They are even slower in .Net so please I insist that if you want to continue arguments then do not mention VB.Net anymore.
RhinoBull, you cannot compare classes in VB6 to classes in .net. VB6 does not have real classes, not by ANY stretch of the imagination. They don't even remotely count as objects either.
Admittedly, .NET wouldn't win the 100 metres OOP sprint (not with C++ hogging the track), but VB6 wouldn't even get into the qualifying rounds. VB6 is so archaic its not even funny any more. So please don't pretend that VB6 is somehow better simply because you have a fondness for VB6. Pino has much VB6 experience and is learning .net at a geometric rate, he knows more about it than you do so just shut up.
I don't live here any more.
-
Jan 16th, 2006, 03:20 PM
#5
Re: What is the point of a class?
 Originally Posted by wossname
RhinoBull, you cannot compare classes in VB6 to classes in .net. VB6 does not have real classes, not by ANY stretch of the imagination. They don't even remotely count as objects either.
Admittedly, .NET wouldn't win the 100 metres OOP sprint (not with C++ hogging the track), but VB6 wouldn't even get into the qualifying rounds. VB6 is so archaic its not even funny any more. So please don't pretend that VB6 is somehow better simply because you have a fondness for VB6. Pino has much VB6 experience and is learning .net at a geometric rate, he knows more about it than you do so just shut up.
This is not a chit-chat wossy and this not amusing. I would expect apologies from you.
-
Jan 16th, 2006, 03:49 PM
#6
Re: What is the point of a class?
We have a VB6 "general maintenance program" that allows us to build entry forms at run time from tables in SQL. We did all this work with ARRAY's and UDT's and function/subs in a MODULE.
It was a huge mistake - that we continue to pay for.
First - enhancing the program is a nightmare - adding columns to an array to store new information about behaviour.
Second - it's an MDI app - so each child form has an entry in the array's...
It would have been so much easier to use a CLASS - and creating a new occurrance of the object for each child form.
The SET/GET part makes so much sense now - you can validate and put all kinds of business logic in the property code.
We are now doing a "report writer user interface" in VB.Net and fully embracing the class concept. Writing up a property to get and set a value might take a bit of time - but it's a really, really good way to organize a large program that will have a future of enhancing.
I've always supported black-box concepts - creating functions to hide logic from the main code. A class is just a really clean way to achieve that goal and a whole lot more.
-
Jan 16th, 2006, 04:36 PM
#7
Thread Starter
Admodistrator
Re: What is the point of a class?
Okay let me put my project, can you tell me if I would need a class for it?
I have a UDT Named person:
[Example]
VB Code:
Public Type Person
FName as string
LName as string
Address as string
Town as string
End Type
Okay, and now I have another type:
VB Code:
Public Type Location
Hemisphere as string
Country as string
X as long
Y as long
End Type
VB Code:
Dim tPerson as Person
Dim tLocation as Location
So in my form, I send some of the info in a strange order to my server
VB Code:
With winsock1
.senddata tPerson.FName & tPserson.LName & Chr(0) & tPerson.Address & chr(0) & tLocation.Country
End with
I fill in the value with previous winsock requests/sends..Is there reason to use a class? I have some other UDT's with permanent values also that I send in some winsocks also.
Is this reason enough to use a class or should I stick with the UDT + other code?
-
Jan 16th, 2006, 06:10 PM
#8
Re: What is the point of a class?
 Originally Posted by Pino
@Rhino,
Is it not true that classes in vb6 are slow?
Based on many performance tests that I have done, yes they are slow. Here's the order from fastest to slowest that code is executed:
.bas modules
.frm form modules
.cls class modules
That's why I typically use regular modules in my projects cause the code is executed so fast. And some of them are even reusable.
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
|