<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>What's Up With Hungarian Notation?</title><link>http://blogs.msdn.com/ericlippert/archive/2003/09/12/52989.aspx</link><description>I mentioned Hungarian Notation in my last post -- a topic of ongoing religious controversy amongst COM developers. Some people swear by it, some people swear about it. The anti-Hungarian argument usually goes something like this: "What is the point of</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>RE: What's Up With Hungarian Notation?</title><link>http://blogs.msdn.com/ericlippert/archive/2003/09/12/52989.aspx#52990</link><pubDate>Tue, 16 Sep 2003 05:18:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:52990</guid><dc:creator>dave sanderman</dc:creator><description>another comment about 'I already know the type because of the declaration' is:  often the declaration and use are distant from each other.  the benefit of using hungarian in that case is that you don't have to look at a line of code and then grovel around to find out how the vars are declared.
</description></item><item><title>RE: What's Up With Hungarian Notation?</title><link>http://blogs.msdn.com/ericlippert/archive/2003/09/12/52989.aspx#52991</link><pubDate>Tue, 16 Sep 2003 05:35:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:52991</guid><dc:creator>Eric Lippert</dc:creator><description>Though you make a good point, I'd counter that by saying that (a) many developers now use some pretty sophisticated editors that can find the declaration very quickly, and (b) I try to keep my routines under three screens long.  If its a local variable, the type is nearby.  If it's a member variable or a global variable then sure, sometimes it is a pain to find the storage type, but really, how often do you care whether that counter is a UINT or a DWORD?</description></item><item><title>RE: What's Up With Hungarian Notation?</title><link>http://blogs.msdn.com/ericlippert/archive/2003/09/12/52989.aspx#52992</link><pubDate>Tue, 16 Sep 2003 06:29:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:52992</guid><dc:creator>ZorbaTHut</dc:creator><description>I've always thought that it would be handy to make that sort of thing a compile-time error. Describe the set of prefixes you plan to use and how they can be associated with each other, then make the compiler scream at you if you do something Wrong.</description></item><item><title>RE: What's Up With Hungarian Notation?</title><link>http://blogs.msdn.com/ericlippert/archive/2003/09/12/52989.aspx#52993</link><pubDate>Tue, 16 Sep 2003 15:06:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:52993</guid><dc:creator>Mike Dimmick</dc:creator><description>There's always the Ada way of doing things: creating new integer types, and new subtypes. However, I suspect that most of us don't have the patience for that. As far as I'm aware, there aren't any mainstream languages apart from Ada that allow us to declare the exact valid range of an integer variable, or differentiate apples from oranges within the type system (i.e. with support from the compiler).

There's less need for Hungarian prefixes in a strong type system like Ada's, or the user-defined type systems of C++ - because the compiler can tell you you're making mistakes.

However, if you have conversion operators and alternate constructors in C++, there's a chance of introducing type errors.</description></item><item><title>RE: What's Up With Hungarian Notation?</title><link>http://blogs.msdn.com/ericlippert/archive/2003/09/12/52989.aspx#52994</link><pubDate>Tue, 16 Sep 2003 20:54:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:52994</guid><dc:creator>Ed Ball</dc:creator><description>My primary argument for Hungarian has to do with making code easier to read. Even if the declaration of a local/member/global variable is just a screen away, that's still too far if I'm trying to quickly figure out this line of code where the debugger dropped me.

My philosophy for Hungarian notation actually falls between your &amp;quot;sensible&amp;quot; and &amp;quot;pointless&amp;quot; philosophies. I don't look to Hungarian to tell me whether an integer is 16- or 32-bit, signed or unsigned, but I also don't look to it to tell me much semantic information -- I figure the actual variable name is good for that. I do want Hungarian to tell me that the variable is an integer (versus a real number, or a Boolean, or a rectangle, or a pen, or whatever). So &amp;quot;nChildren&amp;quot; is probably the number of children, whereas &amp;quot;bChildren&amp;quot; is probably true if there are any children, and &amp;quot;astrChildren&amp;quot; is probably an array of their names. It communicates enough of the type to know what the basic operations on the variable are, and, combined with the variable name, gives solid semantic information.</description></item><item><title>RE: What's Up With Hungarian Notation?</title><link>http://blogs.msdn.com/ericlippert/archive/2003/09/12/52989.aspx#52995</link><pubDate>Sun, 21 Sep 2003 19:05:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:52995</guid><dc:creator>Tim Scarfe</dc:creator><description>As no-one has commented on this yet, I will note that it there is no argument against using it in a language like JScript where there are variants involved. It makes the code 10 times easier to read and look pretty cool to boot :)</description></item><item><title>Reading Code Is Hard</title><link>http://blogs.msdn.com/ericlippert/archive/2003/09/12/52989.aspx#155318</link><pubDate>Mon, 14 Jun 2004 21:52:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:155318</guid><dc:creator>Fabulous Adventures In Coding</dc:creator><description /></item><item><title>re: What's Up With Hungarian Notation?</title><link>http://blogs.msdn.com/ericlippert/archive/2003/09/12/52989.aspx#158604</link><pubDate>Thu, 17 Jun 2004 20:59:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:158604</guid><dc:creator>Dave Anderson</dc:creator><description>&amp;lt;&amp;lt; ...there is no argument against using it in a language like JScript where there are variants involved. It makes the code 10 times easier to read and look pretty cool to boot... &amp;gt;&amp;gt;&lt;br&gt;&lt;br&gt;Ugh. JScript is the WORST kind of language in which to use Hungarian notation, as there is no way to enforce typing.&lt;br&gt;&lt;br&gt;And I disagree with claims that Hungarian Notation makes code easier to read.</description></item><item><title>re: What's Up With Hungarian Notation?</title><link>http://blogs.msdn.com/ericlippert/archive/2003/09/12/52989.aspx#161042</link><pubDate>Mon, 21 Jun 2004 06:23:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:161042</guid><dc:creator>Mike Fitzpatrick</dc:creator><description>I lovr hungarian for all the right reasons. I agree wiht the blooger's comments, but you've got to start somewhere...&lt;br&gt;&lt;br&gt;&lt;a target="_new" href="http://CodeInsight.com/Docs/Programming"&gt;http://CodeInsight.com/Docs/Programming&lt;/a&gt; Standards.doc</description></item><item><title>Hugarian notation - it's my turn now :)</title><link>http://blogs.msdn.com/ericlippert/archive/2003/09/12/52989.aspx#162632</link><pubDate>Tue, 22 Jun 2004 21:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:162632</guid><dc:creator>Larry Osterman's WebLog</dc:creator><description /></item><item><title>re: What's Up With Hungarian Notation?</title><link>http://blogs.msdn.com/ericlippert/archive/2003/09/12/52989.aspx#162738</link><pubDate>Tue, 22 Jun 2004 19:10:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:162738</guid><dc:creator>Jeff Clark</dc:creator><description>If you do use hungarian it also seems like you need to setup some standards so everyone uses the SAME prefixes (however you plan on using then).  If you have multiple people using different prefixes for the same thing then you still end up having to go look at the definition because you don't know what stupid thing is.  Also we'd always run into problems with people manufacturing prefixes for classes they create so you end up with wpbmObject or something indecipherable like that.&lt;br&gt;&lt;br&gt;I used to use it but we hit so many problems due to people making up their own rules that we don't use it anymore.  At first I was pretty skeptical about not using it but as long as you take care and name things appropriately it's not really missed.  Of course if people named things appropriately in the first place then using it would probably not have caused as many problems as it did.&lt;br&gt;</description></item><item><title>Hugarian notation - it's my turn now :)</title><link>http://blogs.msdn.com/ericlippert/archive/2003/09/12/52989.aspx#164329</link><pubDate>Thu, 24 Jun 2004 08:06:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:164329</guid><dc:creator>Larry Osterman's WebLog</dc:creator><description /></item><item><title>re: Hungarian Notation</title><link>http://blogs.msdn.com/ericlippert/archive/2003/09/12/52989.aspx#391336</link><pubDate>Thu, 10 Mar 2005 04:06:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:391336</guid><dc:creator>Cyrus' Blather</dc:creator><description /></item><item><title>re: What's Up With Hungarian Notation?</title><link>http://blogs.msdn.com/ericlippert/archive/2003/09/12/52989.aspx#1370066</link><pubDate>Wed, 27 Dec 2006 21:55:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1370066</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;Hungarian doesn't have any place in production code. &amp;nbsp;It goes beyond &amp;quot;messy&amp;quot; or &amp;quot;dirty&amp;quot;. &amp;nbsp;Most variable names imply their data type. &amp;nbsp;ID is int, Name is string, so on. &amp;nbsp;For complex data types, you get into trouble when people start using their own abbreviations. &amp;nbsp;Class People does it abbriviate to pplPerson? or plePerson, what if there's a pointer ppple? &amp;nbsp;Also most IDEs nowadays(especially VS) provide abundant hover over which tells you data type, among other things.&lt;/p&gt;
&lt;p&gt;Redundancy is bad.&lt;/p&gt;
</description></item><item><title>re: What's Up With Hungarian Notation?</title><link>http://blogs.msdn.com/ericlippert/archive/2003/09/12/52989.aspx#1383682</link><pubDate>Sat, 30 Dec 2006 11:09:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1383682</guid><dc:creator>Bruno</dc:creator><description>&lt;p&gt;Hungarian notation is only useful if you name your variables things like &amp;quot;blah&amp;quot; and &amp;quot;foo&amp;quot;. If you give your variables good, descriptive names, this is a complete non-issue.&lt;/p&gt;
</description></item><item><title>re: What's Up With Hungarian Notation?</title><link>http://blogs.msdn.com/ericlippert/archive/2003/09/12/52989.aspx#1417773</link><pubDate>Fri, 05 Jan 2007 23:37:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1417773</guid><dc:creator>Bruce Leggett</dc:creator><description>&lt;p&gt;Hungarian Notation is psychologically inefficient and counter productive. First, you must learn all the prefixes (this could be a burdensome task in some cases)! Finally, after you &amp;quot;Hungarianize&amp;quot; your code now when you maintain it you have to decode and disect those &amp;quot;Hungarianized&amp;quot; variables. Both are an unecessary mental blow and loss in productivity. Use Descriptive names as Bruno stated. Period.&lt;/p&gt;
</description></item><item><title>re: What's Up With Hungarian Notation?</title><link>http://blogs.msdn.com/ericlippert/archive/2003/09/12/52989.aspx#1463261</link><pubDate>Sun, 14 Jan 2007 03:09:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1463261</guid><dc:creator>Robert Brown</dc:creator><description>&lt;p&gt; &amp;nbsp; &amp;nbsp; As an embedded systems programmer (C), I find Hungarian notation to be extremely beneficial. &amp;nbsp;By &amp;quot;embedded&amp;quot; I mean true embedded programming where an oscilloscope is often used to debug software. &amp;nbsp;Hungarian is a fabulously quick way to assess whether you're mixing fixed-point math with floating point math. &amp;nbsp;Further, it allows a very quick way to determine if you're trying to do mixed integer math between longs and ints (for example), which can cause rollover problems. &amp;nbsp;When implementing software filters that need to run fast (fixed-point) yet need to be reconciled with human-readable data (floating point), Hungarian is a really powerful way to ensure your math makes sense. &amp;nbsp;One glance tells you if you're trying to right-shift a float (oops). &amp;nbsp;Different descriptive variable names in the embedded world often become too cumbersome: iVoltage and fVoltage (Hungarian) is a lot more readable than VoltageFromADconverter and VoltageForUserInterface. &amp;nbsp;Hungarian notation has helped me catch dangerous bugs before software deployment (for example, erasing on-chip flash memory 65535 times instead of just once when mixing longs and ints...given that flash devices can do somewhere around 10k- 100k write cycles before they die, you can see the value in catching this type of bug quickly!).&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; That being said, I can completely understand not using Hungarian for more abstracted languages like Java, C#, etc. &amp;nbsp;The lines between atomic data types are blurred with these languages (which is good for these languages because it makes for easier, faster programming), so type-checking has less serious consequences.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; I think it comes down to applying Hungarian where it makes sense. &amp;nbsp;I never devise long cryptic Hungarian prefixes for complex data structures (for such cases, the name is descriptive enough). &amp;nbsp;Hungarian really helps to prevent type-mixing during mixed math, and to specify scope for improved readability. &amp;nbsp;In any given system, I often will use a platform with Hungarian (C in the embedded processor) and without Hungarian (C# in the PC-based user interface software).&lt;/p&gt;
&lt;p&gt; &amp;nbsp;Just use the right tool for the job if it helps.&lt;/p&gt;
</description></item><item><title>Even good Hungarian notation is still bad</title><link>http://blogs.msdn.com/ericlippert/archive/2003/09/12/52989.aspx#2248439</link><pubDate>Mon, 23 Apr 2007 20:52:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2248439</guid><dc:creator>Greg Beech's Tech Blog</dc:creator><description>&lt;p&gt;I was bored this weekend so I ended up trawling through a bunch of blog archives and came across posts&lt;/p&gt;
</description></item><item><title>re: What's Up With Hungarian Notation?</title><link>http://blogs.msdn.com/ericlippert/archive/2003/09/12/52989.aspx#8965167</link><pubDate>Thu, 25 Sep 2008 18:42:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8965167</guid><dc:creator>Daniel Earwicker</dc:creator><description>&lt;p&gt;To celebrate the 5th aniversary of this post...&lt;/p&gt;
&lt;p&gt;If a variable stores the count of something, put 'count' in its name. That way, you get a more readable version of the semantic indicator and no one can accuse you of being Hungarian. Modern IDEs solve the problem of typing long names (auto completion) and also of looking up the representation (Find declaration...)&lt;/p&gt;
</description></item><item><title>Databases: 50 years of stupidity &amp;laquo; relationary</title><link>http://blogs.msdn.com/ericlippert/archive/2003/09/12/52989.aspx#9385578</link><pubDate>Sat, 31 Jan 2009 03:54:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9385578</guid><dc:creator>Databases: 50 years of stupidity &amp;laquo; relationary</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://relationary.wordpress.com/2009/01/31/databases-50-years-of-stupidity/"&gt;http://relationary.wordpress.com/2009/01/31/databases-50-years-of-stupidity/&lt;/a&gt;&lt;/p&gt;
</description></item></channel></rss>