Stripping the Code

A way to provide an added level of security for your code is to remove all comments, indents, and blank lines from it. Doing this will make interpretation of the code very difficult, even if someone is successful at gaining access to it.

In many of the code samples in this chapter, you will notice that code comment lines are preceded by three apostrophes rather than just one. This is a good practice to follow because it allows you to quickly strip all comments from your code using the built-in VBE find-and-replace function. If you use only one or two apostrophes to designate comments, this function will not be able to distinguish between apostrophes that designate comment lines and those that are embedded in your code for other purposes.

Some developers go as far as changing the routine names, variable names, and anything else that provides a clue to the intent of a routine. This makes it even more difficult to understand and reverse-engineer a project, but it creates a maintenance issue for you. Be sure to save backup copies of your projects before stripping and cleaning your code.