|
-
Sep 7th, 2003, 04:44 PM
#1
Thread Starter
Member
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?!
-
Sep 7th, 2003, 05:51 PM
#2
Fanatic Member
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?
-
Sep 8th, 2003, 07:14 AM
#3
Thread Starter
Member
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?!
-
Sep 8th, 2003, 08:13 AM
#4
Addicted Member
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...
-
Sep 8th, 2003, 12:30 PM
#5
Sleep mode
In addition some like to start their proj from module using Main() method , not me ofcourse . So , I believe it makes sense in VB .
-
Sep 9th, 2003, 03:37 AM
#6
Addicted Member
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!!
-
Sep 9th, 2003, 07:07 AM
#7
Fanatic Member
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.
-
Sep 9th, 2003, 08:25 AM
#8
PowerPoster
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|