Click here to Skip to main content
15,907,231 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Simulating mouse clicks on SysDateTimePick32 control Pin
Gary R. Wheeler17-Jan-06 16:11
Gary R. Wheeler17-Jan-06 16:11 
Questionhow to draw table? Pin
Ali Tavakol14-Jan-06 21:13
Ali Tavakol14-Jan-06 21:13 
AnswerRe: how to draw table? Pin
includeh1015-Jan-06 3:54
includeh1015-Jan-06 3:54 
GeneralRe: how to draw table? Pin
Ali Tavakol15-Jan-06 20:14
Ali Tavakol15-Jan-06 20:14 
Questionvariable, a simple suggestion to C/C++ beginner Pin
includeh1014-Jan-06 17:13
includeh1014-Jan-06 17:13 
AnswerRe: variable, a simple suggestion to C/C++ beginner Pin
El Corazon14-Jan-06 17:49
El Corazon14-Jan-06 17:49 
GeneralRe: variable, a simple suggestion to C/C++ beginner Pin
Stephen Hewitt14-Jan-06 18:03
Stephen Hewitt14-Jan-06 18:03 
GeneralRe: variable, a simple suggestion to C/C++ beginner Pin
El Corazon14-Jan-06 18:39
El Corazon14-Jan-06 18:39 
Stephen Hewitt wrote:
For example a "p" to name a pointer is usefull and will not pose any problems in the future. And if you do, say, change the pointer to a reference, you would have to visit every use of it anyway so no problem.


I agree absolutely on the p designation of pointer and require it in my work (or ptr prefix). But the primary problem with hungarian notation is that it forces you to define two separate rules for naming conventions, one based on C/C++ types and one for your own types.

if I make a variable for x as an integer it is iX, but if I make a vector matrix for multidimensional matrix definitions is it vX? usually no. You then start defining a set of rules exceptions if you will when you will use type designation and when you will not, two separate rules rather than one consistant one. Is mX a map X or a multimap X? is hX a hex string of X or a hash table? Thus you get into enlarging your naming convention to cover all things.
myClass myClassUsageVariable;
myClass *p_myClassUsageVariable;
// or
myClass mcUsageVariable;
myClass *p_mcUsageVariable;
// matches this?
int iIterator;
int *p_iIterator;
// or
int intIterator;
int *p_intIterator;

generally type conventions do not ask hungarian for user classes so then you have:
myClass UsageVariable;
int iIterator;

and start drawing out a long line of rules on what should be combined into hungarian and what should not, two completely different naming conventions. Or worse you decide that everything should be listed in hungarian including class, namespace, orignator of the class, as well as type. Now your variable name is taking the place of documentation. (I have had someone try to request this)
using namespace boost; // 3rd party library from boost
shared_ptr boost_boost_sharedptr_pEarthProjection;

Since boost has shared_ptr and scoped_ptr sp is not enough, so either you start enlarging your type definitions or removing them for all 3rd party and user defined work. Again, making two sets of naming conventions, which I consider worse. It also doesn't provide you with any more information that a proper IDE will. A professional tool will tell you the type, good documentation will tell you the type, auto documentation will tell you the type. But hungarian notation just makes life more difficult.

I did say the subject opens up a religion war of types. I agree with the idea that hungarian notation actually reduces object oriented design and creates redundant overhead and restricts future growth so significantly as to actually damage every product cycle it is used in. You find yourself saying "I don't want to make that change, because it requires me to change all the variable names in 100 source files to upgrade quantity from integer to double" so we will continue selling our software to DVD end-sales and not warehouses so that we do not have to deal with crate SKU quantities (including partials) as well as whole. Now you are redefining your companies goals based on the choice of a variable.

I do not ask everyone to give up hungarian, but I will fight it on my team-projects because the rules are inconsistant, or so redundant as to make it unusable and restrictive.

_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
GeneralRe: variable, a simple suggestion to C/C++ beginner Pin
Shraddhan22-Jan-06 23:34
Shraddhan22-Jan-06 23:34 
Questionstructure representing file Pin
John Simon14-Jan-06 14:50
John Simon14-Jan-06 14:50 
AnswerRe: structure representing file Pin
El Corazon14-Jan-06 15:04
El Corazon14-Jan-06 15:04 
QuestionHard maths problem Pin
Christian Graus14-Jan-06 12:41
protectorChristian Graus14-Jan-06 12:41 
AnswerRe: Hard maths problem Pin
Sean Cundiff14-Jan-06 14:25
Sean Cundiff14-Jan-06 14:25 
GeneralRe: Hard maths problem Pin
Christian Graus14-Jan-06 19:56
protectorChristian Graus14-Jan-06 19:56 
AnswerRe: Hard maths problem Pin
Stephen Hewitt14-Jan-06 14:35
Stephen Hewitt14-Jan-06 14:35 
GeneralRe: Hard maths problem Pin
Christian Graus14-Jan-06 19:52
protectorChristian Graus14-Jan-06 19:52 
AnswerRe: Hard maths problem Pin
Michael A. Barnhart14-Jan-06 14:36
Michael A. Barnhart14-Jan-06 14:36 
AnswerRe: Hard maths problem Pin
El Corazon14-Jan-06 14:41
El Corazon14-Jan-06 14:41 
GeneralRe: Hard maths problem Pin
Christian Graus14-Jan-06 20:05
protectorChristian Graus14-Jan-06 20:05 
Questioni need TIC TAC TOE source vc++ Pin
peyman1361814-Jan-06 10:23
peyman1361814-Jan-06 10:23 
AnswerRe: i need TIC TAC TOE source vc++ Pin
Christian Graus14-Jan-06 12:38
protectorChristian Graus14-Jan-06 12:38 
QuestionAccessing Video Files Pin
AJ12314-Jan-06 9:15
AJ12314-Jan-06 9:15 
AnswerRe: Accessing Video Files Pin
Chris Losinger14-Jan-06 9:45
professionalChris Losinger14-Jan-06 9:45 
Questionloading and displaying images Pin
Fatima Tuz Zahra13-Jan-06 19:37
Fatima Tuz Zahra13-Jan-06 19:37 
AnswerRe: loading and displaying images Pin
zubair_ahmed13-Jan-06 20:06
zubair_ahmed13-Jan-06 20:06 

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.