CClassname

Started by
14 comments, last by antareus 21 years, 3 months ago
quote:That is exactly my point...


I vaguely remember SabreMan saying something like this recently. Gee, I hope I haven''t plaigarized him.
Advertisement
I wonder if those who use C prefix also use it in templates.

  template <class CIterator>...  

Well, the obvious problem is that iterator might be a basic type as well as a class.
I''ll throw in my two cents. Its all style, true, but Hungarian notation can be abused. Personally I only use:

int* pMyInt = new int; //remind me to use delete([]) and -> only
int m_classInt; //this is local to the class

But I might try _classInt to see if that is prettier
--God has paid us the intolerable compliment of loving us, in the deepest, most tragic, most inexorable sense.- C.S. Lewis
My preference is to prefix variables to indicate scope:

int g_globalVariable;class MyClass {    int m_memberVariable;}; 


This is handy for passing constructor arguments that have the same name as member variables.

One problem with hungarian type prefixes is that nobody seems to use the same prefix for the same data type. Examples:

unsigned int uMyUnsignedInteger;unsigned int uiMyUnsignedInteger;unsigned int nMyNumber;char* pcMyPointerToChar;char* strMyString;char* szMyString;char* pszMyPointerToString;char* lpszMyLongPointerToString; 


Catch my drift?

Having said that, I would be inclined to use hungarian in an MFC application for the sake of consistency. But where possible, I avoid it like the plague.
Well, let's just go crazy on the datatype names.


    #include <iostream>using namespace std;typedef int byte4DT;typedef char byte1DT;typedef float byte4DTF;struct str_UCT_mySTRUCT{    byte4DT b4dt_myAge;    byte1DT b1dt_myName[15];    byte4DTF b4dtf_myFloat;};int main(){    str_UCT_mySTRUCT strUCTmySTRUCT_Person;        cout << "Enter my name: ";    cin >> strUCTmySTRUCT_Person.b1dt_myName;    cout << "Enter my age: ";    cin >> strUCTmySTRUCT_Person.b4dt_myAge;    cout << "Enter a decimal: ";    cin >> strUCTmySTRUCT_Person.b4dtf_myFloat;        return 0;}    


For anyone who cares, this was a poorly executed joke that took about 15 minutes of my time.

"aut viam inveniam aut faciam " - I will either find a way or make one.

MoonStar Projects

[edited by - Ronin Magus on December 27, 2002 11:40:12 AM]
Personally I think T for Type if far superior
Keys to success: Ability, ambition and opportunity.

This topic is closed to new replies.

Advertisement