Click here to Skip to main content
15,911,646 members

Survey Results

Naming conventions in your code   [Edit]

Survey period: 24 Nov 2003 to 30 Nov 2003

What notations do you use when coding?

OptionVotes% 
Hungarian notation with prefixes (strFirstName, m_nNumber etc)76150.13
Hungarian notation without prefixes ( _nNumber etc)432.83
Camel Caps (numberOfDays, isValid etc)46230.43
Pascal case (BackColor, DataSet)17911.79

View optional text answers (92 answers)


 
GeneralRe: Hungarian is evil Pin
Navin26-Nov-03 3:16
Navin26-Nov-03 3:16 
GeneralRe: Gool ol' Hungarian Pin
deo25-Nov-03 12:15
deo25-Nov-03 12:15 
GeneralRe: Gool ol' Hungarian Pin
Patje25-Nov-03 22:58
Patje25-Nov-03 22:58 
GeneralRe: Gool ol' Hungarian Pin
Mehdi Mousavi26-Nov-03 1:40
Mehdi Mousavi26-Nov-03 1:40 
GeneralRe: Gool ol' Hungarian Pin
peterchen29-Nov-03 2:53
peterchen29-Nov-03 2:53 
GeneralOnly habits... Pin
andyj11524-Nov-03 2:14
andyj11524-Nov-03 2:14 
GeneralRe: Only habits... Pin
Anonymous24-Nov-03 8:32
Anonymous24-Nov-03 8:32 
GeneralRe: Only habits... Pin
Dimitris Vasiliadis25-Nov-03 9:22
Dimitris Vasiliadis25-Nov-03 9:22 
I use Hungarian notation with prefixes too, but I strongly believe that when working with a group there should be only a standarized point of view, not personals, because groups change, but the code still remains there.

When looking someone else's code and you see somewhere a variable named m_pCurrentObj, and pCurrentObj where whould you look first to find the declaration? I would suppose that the first one is a member variable (pointer) and look in the class declaration to find it and the second one be a local variable and look in the function. But if you were unsure that the person who wrote the code used some naming convention, where whould you whould look for a variable named "currentobj".

How many of us have checked on MSDN for code samples and documentation. What whould happen if every developer that has posted his code there used his own personal naming method. How much easy could anyone use the samples and check his code against the articles?

My opinion is that since naming conventions are for humans, they should be used in such a way to make everybody's life (in a group at least) easier. If it was for computers, names with only one letter and numbers such as A1234, A4562, A3468796 are better than enough, but are such names acceptable?

What meaning whould a class declaration have like this:
<br />
typedef char* A23423;<br />
<br />
class A457887665 {<br />
public:<br />
	A457887665() {A8768764=0;}<br />
	~A457887665() {}<br />
	void A7456376(A23423 A9874) {A45345 = A9874;}<br />
protected:<br />
	int A8768764;<br />
	A23423 A45345;<br />
};<br />



...Plug & Pray... Dead | X|
GeneralRe: Only habits... Pin
andyj11525-Nov-03 9:37
andyj11525-Nov-03 9:37 
GeneralRe: Only habits... Pin
Dimitris Vasiliadis25-Nov-03 20:06
Dimitris Vasiliadis25-Nov-03 20:06 
GeneralRe: Only habits... Pin
Navin25-Nov-03 9:47
Navin25-Nov-03 9:47 
GeneralRe: Only habits... Pin
John R. Shaw25-Nov-03 9:53
John R. Shaw25-Nov-03 9:53 
GeneralRe: Only habits... Pin
andyj11525-Nov-03 10:20
andyj11525-Nov-03 10:20 
GeneralRe: Only habits... Pin
John R. Shaw25-Nov-03 10:46
John R. Shaw25-Nov-03 10:46 
GeneralRe: Only habits... Pin
andyj11526-Nov-03 2:05
andyj11526-Nov-03 2:05 
GeneralRe: Only habits... Pin
John R. Shaw27-Nov-03 8:14
John R. Shaw27-Nov-03 8:14 
GeneralHungarian, but a simple version Pin
Anonymous24-Nov-03 1:56
Anonymous24-Nov-03 1:56 
GeneralRe: Hungarian, but a simple version Pin
Anonymous25-Nov-03 9:14
Anonymous25-Nov-03 9:14 
GeneralRadiobuttons not adequate for this question Pin
jhwurmbach24-Nov-03 1:35
jhwurmbach24-Nov-03 1:35 
GeneralThis poll is silly Pin
dog_spawn24-Nov-03 6:45
dog_spawn24-Nov-03 6:45 
GeneralC++ is so rich in types... Pin
Bamaco224-Nov-03 0:43
Bamaco224-Nov-03 0:43 
GeneralRe: C++ is so rich in types... Pin
Paul Watson24-Nov-03 5:26
sitebuilderPaul Watson24-Nov-03 5:26 
GeneralRe: C++ is so rich in types... Pin
Bamaco224-Nov-03 9:05
Bamaco224-Nov-03 9:05 
GeneralRe: C++ is so rich in types... Pin
JaniOrca25-Nov-03 1:44
JaniOrca25-Nov-03 1:44 
GeneralDepends Pin
Thomas Freudenberg23-Nov-03 19:54
Thomas Freudenberg23-Nov-03 19:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.