473,320 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Naming convention of Variables

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

Sep 13 '06 #1
4 1754
<ro****@joshie.com.auwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
>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.


Sep 13 '06 #2
<ro****@joshie.com.auschrieb:
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??
Naming guidelines and code conventions
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=namingconventions&lang=en>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Sep 13 '06 #3

<ro****@joshie.com.auwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
>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/
Sep 13 '06 #4
<ro****@joshie.com.auha scritto nel messaggio
news:11**********************@i42g2000cwa.googlegr oups.com...
>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/de...guidelines.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.
--

Free .Net Reporting Tool - http://www.neodatatype.net
Sep 13 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Sandeep Sharma | last post by:
For many years I have been following the convention of naming all class attributes with a leading underscore. This enables me to quickly identify the class attributes when I encounter them in the...
27
by: Derek | last post by:
The company where I work uses a naming convention that I have never used before. They use mixed-case letters for public member functions, but lower-case with underscores for the rest, like this:...
7
by: DEX | last post by:
Main page of my NC: http://www.ddmrm.com/coding/cpp/naming/cpp.naming.main.html Rules of my NC: http://www.ddmrm.com/coding/cpp/naming/cpp.naming.rules.html Comments are welcome. ...
7
by: cmiddlebrook | last post by:
Hi there, I keep finding myself getting inconsistent with naming conventions for things like member variables, class names etc and I just want to find something that suits me and stick to it. I...
4
by: Mark Broadbent | last post by:
stupid question time again to most of you experts but this is something that continually bothers me. I am trying to get into the habit of naming variables and controls in an assembly as per...
48
by: Robert Jacobson | last post by:
Hello all, If I have a class called "Foo," is there a preferred naming convention for iterating through each Foo instance in a collection of Foos? I've seen several different variations, even...
0
by: Carl Colijn | last post by:
Hi all, Disclaimer: before I might trigger your "let's start a holy war!" button, I'd like to say I'm not intended to; I just post this message to get some input and not to promote "Yet Another...
8
by: bim_bom | last post by:
Hi, is there any tool to change naming convention in c++ sources? I mean something, that parses cpp and h files in my project, and it finds, what variables are there declared. I think, it should...
114
by: Jonathan Wood | last post by:
I was just wondering what naming convention most of you use for class variables. Underscore, "m_" prefix, camel case, capitalized, etc? Has one style emerged as the most popular? Thanks for...
35
by: Smithers | last post by:
Is it common practise to begin the name of form classes with "frm" (e.g., frmOneForm, frmAnotherForm). Or is that generally considered an outdated convention? If not "frm" what is a common or...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.