Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

code library numbering

Status
Not open for further replies.

matrixindicator

IS-IT--Management
Sep 6, 2007
418
BE
Has someone some recommandations (best practice) or are there formal or non-formal convencions to define the name of functions and subs.
If you get a list large list of, is there a way to number the functions

mod001DelTables ?
 
The only real naming convention I use when naming Subs and Functions is to make the name as descriptive as possible without allowing the name to get overly long.

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
I don't even get too worried about the names being too long, as long as they're descriptive.
Grouping them in modules by function is helpful too, remember you can 'fully qualify' a function using the module name.
eg create a module called Database and another called TextFiles, you can have a sub or function called Read() in both of them and in your working code have
Code:
Sub test()
Database.read
TextFiles.read
End Sub

Don't get this confused with creating class modules with properties and the like. Although it seems similar, and you can use class modules in this way, you are doing very different things.

hth

Ben

----------------------------------------------
Ben O'Hara
David W. Fenton said:
We could be confused in exactly the same way, but confusion might be like Nulls, and not comparable.
 
in most efforts, prefer function over form (or format). if the convention is meaningful it will be more easily remembered and thus easier to use. if, for some reason, you will be able to remember the modules / functions with a convention of numbering them, that would work best for you. if the overall application is strictly private, then this may also be best for the overall project. if, however, the project is (or ever will be) shared, then a naming convention based on a group consensus is certainly preferred.

One other (personal) preference is to not have any two function names the same (even when in different modules) (except the occasional code behind forms event procedures).



MichaelRed


 
tx for the response, some I ideas I get from yours :

modCodeBasic (module)

DelAllTables (function with group name Del)
DelAllForms (function with group name Del)


Call modCodeBasic.DelAllTables

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top