"SharkD" <nomail@nomail> wrote in message
> In order for an object to be compliant, can I simply change all the
> variables in
> the include file to local scope? Or, must I also rename them all using the
> object's abbreviation?
> I'm guessing that best practices is to do both.
The main objective is to avoid collisions with names chosen by someone using
your include file, so in theory either would normally suffice and could be
considered compliant. On the other hand, I've started using the unique
prefix for the names of all identifiers (even local ones) because I noticed
some circumstances where it removes some less usual potential conflicts.
Normally someone using your include file would simply include it in their
own higher level scene file which should make using identifiers in your
include file with a local scope quite safe. However, it's also possible that
they may elect to do things a little differently, for example by adding
their own stuff into your include file or by copying and pasting parts of
your file into their own scene file. In these circumstances there is
potential for the names you use in your local definitions to conflict with
their own global declarations. I would therefore say that it is preferable
to use the unique prefix everywhere as it makes it that little bit more
robust in a wider range of circumstances.
Post a reply to this message