Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The problem with asking for good examples of Hungarian Notation is that everyone's going to have their own idea of what a good example looks like. My personal opinion is that the best <a href="http://en.wikipedia.org/wiki/Hungarian_Notation" rel="noreferrer" title="Wikipedia article">Hungarian Notation</a> is <strong>no Hungarian Notation</strong>. The notation was originally meant to denote the <em>intended usage</em> of a variable rather than its type but it's usually used for type information, particularly for Form controls (e.g., <em>txtFirstName</em> for a text box for someone's first name.). This makes the code less maintainable, in terms of readability (e.g., "prepIn nounTerms prepOf nounReadability") and refactoring for when the type needs to be changed (there are "lParams" in the Win32 API that have changed type).</p> <p>You should probably consider not using it at all. Examples:</p> <ul> <li><strong>strFirstName</strong> - this can just be <strong>firstName</strong> since it's obvious what it's for, the type isn't that important and should be obvious in this case. If not obvious, the IDE can help you with that.</li> <li><strong>txtFirstName</strong> - this can change to <strong>FirstNameTextBox</strong> or <strong>FirstName_TextBox</strong>. It reads better and you know it's a control and not just the text.</li> <li><strong>CAccount</strong> - <em>C</em> was used for class names in MFC but you really don't need it. <strong>Account</strong> is good enough. The uppercase name is the standard convention for types (and they only appear in specific places so they won't get confused with properties or methods)</li> <li><strong>ixArray</strong> (index to <em>array</em>) - <code>ix</code> is a bit obscure. Try <strong>arrayIndex</strong>.</li> <li><strong>usState</strong> (unsafe string for <em>State</em>) - looks like "U.S. State". Better go with <strong>state<code>_</code>UnsafeString</strong> or something. Maybe even wrap it in an <strong><em>UnsafeString</em></strong> class to at least make it type-safe.</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload