Easy question for you vets out there:
What is the accepted (assuming there is one…) prefix for a CString variable name? For clarification, I’ve seen the following for other data types:
int iIndex; //integer
int* pIndex; //pointer
bool fFlag; //bool flag
And there are countless others. Please feel free to let me know if this is really a non-question or something with a “Whatever you want” answer.
Prefixes such as those are an abuse of the concept of Hungarian Notation.
The idea of HN is that a variable is prefixed with a code describing its use. e.g., a variable holding the count of something would be prefixed
cnt; a variable holding an index would be prefixedinx. A variable holding a flag would be prefixedf. A variable holding a number (that wasn’t a count or an index or something else common) would be prefixedn.However, soon people got lazy, (and largely due to that last example) and the prefixes started to be just an indication of the data type. This has some use in C, where the declaration of a variable had to be at the top of the function, potentially some distance from where it is used. (especially when code was written in a simple text editor)
But, eventually, we got more type safe languages, and better IDEs, so the faux-Hungarian Notation because unnecessary and scorned.