ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Coding best practice question (https://www.excelbanter.com/excel-programming/329067-coding-best-practice-question.html)

Mark Stephens

Coding best practice question
 
I insert a module titled PubDec in my workbook and store all my public
statements in it. Sometimes I don't use it but declare it at the top of the
module it is being used in. Is there any advantage/disadvantage to this is
there a 'best practice' methodology for where you should store them?

Thanks, Mark



Bob Phillips[_7_]

Coding best practice question
 
I don't think there is any 'best practice' Mark.

What I do is created a Global module if it is a big application that has
many such variables, makes them easier to find.

Like you, if I have just a small app, I put them in a code module.

--
HTH

Bob Phillips

"Mark Stephens" wrote in message
...
I insert a module titled PubDec in my workbook and store all my public
statements in it. Sometimes I don't use it but declare it at the top of

the
module it is being used in. Is there any advantage/disadvantage to this is
there a 'best practice' methodology for where you should store them?

Thanks, Mark





Jim Thomlinson[_3_]

Coding best practice question
 
I concure with your reasoning. If it is a big enough application then a
public declarations module is a great idea. The only thing I would comment on
is the name of the module. If you fall of the face of the earth the person
coming after you is going to have to figure out all of your abbreviations. I
make it a practice not to abbreviate as much as possible.
modPublicDeclarations would in my opinion be a much better name. There is no
mistaking that is is a module containing all of your public declarations. I
find that doing this even novices can look at my code and have some idea what
is going on. Just my two cents.

HTH

"Mark Stephens" wrote:

I insert a module titled PubDec in my workbook and store all my public
statements in it. Sometimes I don't use it but declare it at the top of the
module it is being used in. Is there any advantage/disadvantage to this is
there a 'best practice' methodology for where you should store them?

Thanks, Mark





All times are GMT +1. The time now is 12:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com