DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Why modules at all ?

  1. #1
    Join Date
    Aug 2004

    Why modules at all ?

    [Originally posted by kukka]

    I was wondering if we can do away with standard modules completely from˙ a project. Cant we have the constants and the global routines in a GlobalMutliuse class ? Am I missing something ?.
    Thanks in advance

  2. #2
    Join Date
    Aug 2004

    Re:Why modules at all ?

    [Originally posted by HighCommander]

    I'm going to guess that most people will say "You don't need to create an instance of a module". Classes are good for creating similar type objects that contain information about themselves and can manipulate themselves.

    A module will let you have sub-routines and functions that aren't based on a certain type of class and can be used by everything.

    Lets say you have a class for cars, the model of the car is "LeSabre". You want to know the length of the model.. are you going to put code in the class that EVERY instance of the class will carry around with it, or would you put a function in a module that can check the length of text no matter where is? (O.K. so the Len() function doesn't take up much space, but then this is only an example)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center