Results 1 to 30 of 30

Thread: What is the point of a class?

Hybrid View

  1. #1
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: What is the point of a class?

    Quote 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.

  2. #2
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: What is the point of a class?

    Quote 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?

  3. #3

  4. #4
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: What is the point of a class?

    Quote 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.

  5. #5
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: What is the point of a class?

    Quote 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.

  6. #6
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    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.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  7. #7

    Thread Starter
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    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:
    1. Public Type Person
    2.      FName as string
    3.      LName as string
    4.      Address as string
    5.      Town as string
    6. End Type

    Okay, and now I have another type:

    VB Code:
    1. Public Type Location
    2.      Hemisphere as string
    3.      Country as string
    4.      X as long
    5.      Y as long
    6. End Type

    VB Code:
    1. Dim tPerson as Person
    2. Dim tLocation as Location

    So in my form, I send some of the info in a strange order to my server

    VB Code:
    1. With winsock1
    2.      .senddata tPerson.FName & tPserson.LName & Chr(0) & tPerson.Address &  chr(0) & tLocation.Country
    3. 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?

  8. #8
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: What is the point of a class?

    Quote 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
  •  



Click Here to Expand Forum to Full Width