Results 1 to 2 of 2

Thread: Large VB executibles

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Location
    New York City
    Posts
    73

    Unhappy

    I'm writing an application with VB and SQL server. Right now the app is one large monolithic exe that I want to break up into modules or pieces. What is the best method to break up forms with data access in an app into different modules yet share information between them?

    Thanks!!
    Rich

  2. #2
    Guest
    WHOOOOOOOOO BOY! You are going to start a Holy War on this
    one. To start, let say that this is how I do it. I have a
    lot of rules that I follow and I get accused of trying to
    force them on others all the time.

    1. Don't worry about having too many modules. You can't.

    2. I don't put subroutines and functions in the same
    module. I like to re-use code as much as possible, so I
    like to keep functions to themselves. BTW, I try my best
    to write every function as an independent entity. It's not
    always possible, but I think it is always a good idea to
    try.

    3. Avoid home written functions calling other home written
    functions, unless the calling/called functions are in the
    same module. This means that re-using the functions will
    be less painful 2 years from now when you have a senior
    moment on this code.

    4. Use some kind of naming convention within modules for
    the variables and the function/subroutine names. Use the
    same convention when naming the module. This makes it
    easier to find the original function, after you screw it up
    trying to re-use it somewhere else.

    5. Keep the individual functions/subroutines SMALL. I try
    to have no more than 15 lines of functioning code in a
    function, no more than 25 in a subroutine. Makes de-
    bugging a LOT easier.

    6. A function/subroutine should do one thing and ONLY one
    thing. Loading functions/subroutines leads to subtle
    errors that are incredibly difficult to track down.

    7. Whatever works for you, works period. Don't get
    bogged down by the "Proper" way to do something. Sooner or
    later in the life of every project it becomes time to shoot
    the engineers and put the product on the street.


    Good Luck
    DerFarm

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