    <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
     <channel>
        <title>ACCU  :: More Thoughts About Hungarian Notation</title>
        <link>https://members.accu.org/index.php/journals/871</link>
        <description>Professionalism in Programming</description>
        <dc:language>en-us</dc:language> 
        <dc:creator>Administrator</dc:creator> 
        <admin:generatorAgent rdf:resource="http://www.xaraya.org" /> 
        <admin:errorReportsTo rdf:resource="mailto:webeditor@accu.org" />
       <sy:updatePeriod>hourly</sy:updatePeriod>
       <sy:updateFrequency>1</sy:updateFrequency>
       <docs>http://backend.userland.com/rss</docs>


        <h2>Journal Articles</h2>


<div class="xar-mod-head"><span class="xar-mod-title">CVu Journal Vol 11, #3 - Apr 1999 + Programming Topics</span></div>

<table border="0" cellpadding="1" cellspacing="0">
    <tbody>
    <tr>
        <td valign="top">
            Browse in :
       </td>
       <td valign="top">

                                            <a href="https://members.accu.org/index.php/journals/">All</a>

                     &gt;                         <a href="https://members.accu.org/index.php/journals/c76/">Journals</a>

                     &gt;                         <a href="https://members.accu.org/index.php/journals/c77/">CVu</a>

                     &gt;                         <a href="https://members.accu.org/index.php/journals/c132/">113</a>
                    (22)
<br />

                                            <a href="https://members.accu.org/index.php/journals/">All</a>

                     &gt;                         <a href="https://members.accu.org/index.php/journals/c13/">Topics</a>

                     &gt;                         <a href="https://members.accu.org/index.php/journals/c65/">Programming</a>
                    (877)
<br />

                                            <a href="https://members.accu.org/index.php/journals/c132-65/">Any of these categories</a>

                    -                        <a href="https://members.accu.org/index.php/journals/c132+65/">All of these categories</a>
<br />
</td>
   </tr>
   </tbody>
</table>




<div class="xar-error">
   <p>
 <strong>Note:</strong> when you create a new publication type,
the articles module will automatically use the templates
<em>user-display-[publicationtype].xt</em>
and <em>user-summary-[publicationtype].xt</em>.
If those templates do not exist when you try to preview or display a new article,
you'll get this warning :-)  Please place your own templates in themes/<em>yourtheme</em>/modules/articles . The templates will get the extension .xt there. </p>
</div>
<div class="xar-norm xar-standard-box-padding">
   <h1><strong>Title:</strong>&nbsp;More Thoughts About Hungarian Notation</h1>
<p><strong>Author:</strong>&nbsp;</p>
<p>
<strong>Date:</strong> 03 April 1999 13:15:30 +01:00 or Sat, 03 April 1999 13:15:30 +01:00</p>
<p><strong>Summary:</strong>&nbsp;</p>
<p><strong>Body:</strong>&nbsp;<div class="article" lang="en">
<div class="titlepage">
<div>
<div>
<h2><a name="d0e1" id="d0e1"></a>More Thoughts About
Hungarian Notation</h2>
</div>
<div class="author">
<h3><span class="firstname">Kevin</span>
<span class="surname">McFarlane</span></h3>
<tt class="email">&lt;<a href=
"mailto:kevin@atech.globalnet.co.uk">kevin@atech.globalnet.co.uk</a>&gt;</tt></div>
</div>
<hr></div>
<div class="section" lang="en">
<div class="titlepage">
<h2><a name="d0e20" id="d0e20"></a></h2>
</div>
<p>The Harpist's reply to my article on Hungarian notation (C Vu
11.1) draws out more explicitly the concepts I was groping towards.
We need to distinguish between two aspects of Hungarian -
&quot;type-specific&quot; and &quot;scope-specific&quot; identification. Hungarian is
invaluable for the latter but not for the former.</p>
<p>The Harpist does make some concession towards type-specific
identification, e.g., for pointers. The suggestion that we use
suffixes rather than prefixes is probably a good one and it does
follow the C convention for typedefs. Nevertheless, my personal
preference is to use prefixes, probably because this style is more
widely used and so I am used to it. Most of the time, in a
commercial environment, one's code must integrate with that of
others and, if Hungarian is being used, it is usually the prefix
form. It would decrease readability if I were to adopt the suffix
form in such instances.</p>
<p>In my earlier article I mentioned that adopting Hungarian for UI
widgets was very useful. Although this is type-specific
identification it is not as disruptive as type-specific
identification for simple data types. This is because, with the
former, a change of choice of UI widget usually necessitates a
change in the program structure as well. So going through the code
and changing &quot;txtBox&quot; to &quot;cmbBox&quot; is not simply a tedious exercise
but also necessitates a code rewrite, as the methods for the two
object types are different.</p>
<p>But for simple data types the only thing we have to do is change
the identifiers, as their &quot;methods&quot; are just operators and these
are more-or-less common between data types. Such an exercise then
just seems like an unproductive chore, despite the fact that modern
code editors make it easy to do.</p>
<p>Alan Lenton points out that Hungarian may aid pattern
recognition for the human user. I think this &quot;aid to pattern
recognition&quot; is more beneficial for GUI &quot;front-end&quot; applications
than for data-manipulative &quot;back-end&quot; applications. I said that
scope identification was invaluable but type identification not. In
practice, when studying or maintaining the code of others, I have
found the lack of scope identification far more of a barrier to
comprehension than the lack of type identification.</p>
<p>In regard to the bubble help and other visual cues that Alan
mentions, it should be noted that the latest version of Microsoft's
Visual C++ fulfils some of these tasks with its IntelliSense
features. For example, it displays an identifier's type as a tool
tip when you hover the mouse over it or type Ctrl+T.</p>
<p class="c2"><span class="remark">Forgive me if I add a couple of
comments.</span></p>
<p class="c2"><span class="remark">It would be most unfortunate if
the existence of an inferior solution to a problem prevented a
better solution simply because the inferior one was widely used.
C++ code suffers from this in many places. For example the
widespread use of friend to support overloading operators (there
are at least two better options). The widespread test for
self-assignment in providing an operator=() is another that springs
to mind. I believe we need to take every opportunity to campaign on
behalf of better idioms.</span></p>
<p class="c2"><span class="remark">Secondly I believe that using
namespaces will go a long way to provide scope information in a way
that allows that information to be omitted if the programmer thinks
it unhelpful.</span></p>
</div>
</p>
<p><strong>Notes:</strong>&nbsp;</p>
<p><em>More fields may be available via dynamicdata ..</em></p>
</div>
</channel>
</rss>
