Naming convention of Variables

R

robear

A while ago, I found a web page that describe an array of naming
conventions when diming a variabe.

For instance:
tbl for table, str for string, i for integer.. (eg: tblMyTable,
strMyString, iMyint, etc)

I know there isn't a hard or fast rule of how your variable names
should be formed, but my real question is does anyone have any links to
web pages (M or other) that suggest types of naming conventions
(prefixes) for different types variables??

Thanks,
Robert
 
R

Robinson

A while ago, I found a web page that describe an array of naming
conventions when diming a variabe.

For instance:
tbl for table, str for string, i for integer.. (eg: tblMyTable,
strMyString, iMyint, etc)

I know there isn't a hard or fast rule of how your variable names
should be formed, but my real question is does anyone have any links to
web pages (M or other) that suggest types of naming conventions
(prefixes) for different types variables??

imho this is less neccessary or useful nowdays with good intellisense and
tooltips in the development environment. However I still prefix class
members with "m_" and global singletons with "g_", or shared variables with
"s_". Overall it doesn't matter too much as long as you are consistent, at
least as far as maintenance is concerned.
 
M

Mike Lowery

A while ago, I found a web page that describe an array of naming
conventions when diming a variabe.

For instance:
tbl for table, str for string, i for integer.. (eg: tblMyTable,
strMyString, iMyint, etc)

I know there isn't a hard or fast rule of how your variable names
should be formed, but my real question is does anyone have any links to
web pages (M or other) that suggest types of naming conventions
(prefixes) for different types variables??

I've always found the suggestions here to be favorable:
http://www.xoc.net/standards/
 
F

Fabio

A while ago, I found a web page that describe an array of naming
conventions when diming a variabe.

For instance:
tbl for table, str for string, i for integer.. (eg: tblMyTable,
strMyString, iMyint, etc)

I know there isn't a hard or fast rule of how your variable names
should be formed, but my real question is does anyone have any links to
web pages (M or other) that suggest types of naming conventions
(prefixes) for different types variables??

The page is this:

http://msdn.microsoft.com/library/d...en-us/cpgenref/html/cpconnamingguidelines.asp

And as it says you should avoid the prefix and choose a good descriptive
name (i.e. "person" is good for a Person class, not for a string with the
person name in it, for this use personName).

The intellisense will do the rest.
 

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