Results 1 to 8 of 8

Thread: modules - good or bad?

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2002
    Location
    la la la you can't see me
    Posts
    46

    modules - good or bad?

    OK, I've been wondering -- is there a reason I shouldn't use modules to get access to vars in multiple forms? It seems like everybody else suggest passing references, creating functions to get and set values, and it all seems like a waste of effort to me.
    What does "formatting drive C..." mean?!

  2. #2
    Fanatic Member Geespot's Avatar
    Join Date
    Oct 2001
    Location
    Birmingham, UK
    Posts
    577
    I tend to keep away from modules because imo I feel my code isn't OOP no more, and I like to keep to OOP as much as possible.

    I think it depends what is required in your project. It's a tough subject. Some projects requires methods that all your classes need access too, modules would work wonders now.

    But without a module, a lot more work is envolved. I don't think modules are 'good' or 'bad'. I think they there just to help. And if they there to help, why not use them?

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2002
    Location
    la la la you can't see me
    Posts
    46
    yeah...
    if you do it right, it can still be object oriented, like i have a couple of classes to represent a player's inventory, and the drug market (I'm trying to expand on drug wars), so it's still possible.
    What does "formatting drive C..." mean?!

  4. #4
    Addicted Member
    Join Date
    Feb 2002
    Location
    closed
    Posts
    196
    Modules are just classes by a different name (compiled behind the scenes), they are a hangover from VB6 - probably to provide a level of familiarity to a heavy module user.

    for global access to methods far better to use SHARED access classes. Apart from anything else giving the full class/method name makes things a bit more easy on the eye.

    Cheers...

  5. #5
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    In addition some like to start their proj from module using Main() method , not me ofcourse . So , I believe it makes sense in VB .

  6. #6
    Addicted Member
    Join Date
    Feb 2002
    Location
    closed
    Posts
    196
    In addition some like to start their proj from module using Main() method
    you can just place your Main() in a class along with other shared methods - for no good reason i say...death to the module!!

  7. #7
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681
    I mainly use modules to store collections that will be shared among several classes, so I only hit the Database once and then the data is available from then on to whatever classes want to use it.

    Also, a module is compiled into a class (Shared) behind the scenes anyway.

  8. #8
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    I would have to say avoid using modules. Like some others said, under the covers (IL), it's a class, exposing static members with private constructors. If you ever decide to move to C#, it will be slightly easier migration, since bas modules do not exists, not to mention, its not truly oo.

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