CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2000
    Posts
    149

    Advice on a Library of Functions

    Hello,
    I have found myself going back to code I have written to cut and paste functions or procedures in new projects, and I thought it's about time I start to make a Library of helpful functions for use in the future.

    What I want to know is, if I was to say make a library of String Functions, should I put the functions in a Class Module(.cls) or just Module(.bas)?

    And why should I choose one over the other?

    Thanks,

    Sean


  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    2

    Re: Advice on a Library of Functions

    Howdy,
    I'd say you're probably best with .bas files; certainly true while you're still coding changes in. They tend to be easier to maintain, which is handy when developing them, as you don't have any of the worries of object compatibility, (which is nice). I tend to use classes to encapsulate data/code units together. By this I mean if I had a custom data structure that required functionality that was only relevant to the data held within that structure I'd build a class, thus encapsulating the data, and the code which runs over that data into one logical unit, (I realise thats a bit wordy, but I'm a coder, not shakespeare!). Building a good system around classes tends to be a fairly precise affair, especially with VB, (as it's not *entirely* Object Oriented...), and I would recommend sitiing down and really reasoning out your design. Classes in VB can really come into their own when designing distributed n-tier systems, (along with transaction processing, MQ's, etc).

    My advice, (and it is, like all the above, just advice, not ultimate truth!) - stay with .bas for now.

    HTH.....?

    Jim Patterson.
    Developer.

  3. #3
    Join Date
    Feb 2000
    Posts
    149

    Re: Advice on a Library of Functions

    Thanks for the input!


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

Featured