variable naming conventions

Z

zkid

I have seen people use int or just i, str or just s, etc., in front of
variable names.

It seems people have their own preferences. Does anyone know of a website
that provides proper varable naming conventions?

Thanks.
 
H

Helmut Weber

Hi,

google for:

Reddick VBA Naming Conventions

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
J

Jonathan West

zkid said:
I have seen people use int or just i, str or just s, etc., in front of
variable names.

It seems people have their own preferences. Does anyone know of a website
that provides proper varable naming conventions?

Thanks.

There is no single "proper" way. Simply remember that the code serves 2
purposes

1. it is a set of instructions for the computer

2. It is a message to yourself or your successor as to what you were trying
to get the computer to do.

Naming conventions are just that - conventions, and by definition more or
less arbitrary. Choose one which suits you and those you work with.

Having a naming convention that uses prefixes for variable types serves two
purposes.

- It enables you to immediately identify the type of a variable, and
therefore the range of things you can do to it.

- It more or less eliminates any chance that you will accidentally give a
variable the same name as an object within the Word object model.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top