Hungarian Notation - Notable Opinions

Notable Opinions

  • Robert C. Martin (against Hungarian notation and all other forms of encoding):

    ".. nowadays HN and other forms of type encoding are simply impediments. They make it harder to change the name or type of a variable, function, member or class. They make it harder to read the code. And they create the possibility that the encoding system will mislead the reader."

  • Linus Torvalds (against Systems Hungarian):

    "Encoding the type of a function into the name (so-called Hungarian notation) is brain damaged—the compiler knows the types anyway and can check those, and it only confuses the programmer."

  • Steve McConnell (for Hungarian):

    "Although the Hungarian naming convention is no longer in widespread use, the basic idea of standardizing on terse, precise abbreviations continues to have value. Standardized prefixes allow you to check types accurately when you're using abstract data types that your compiler can't necessarily check."

  • Bjarne Stroustrup (against Systems Hungarian for C++):

    "No I don't recommend 'Hungarian'. I regard 'Hungarian' (embedding an abbreviated version of a type in a variable name) a technique that can be useful in untyped languages, but is completely unsuitable for a language that supports generic programming and object-oriented programming—both of which emphasize selection of operations based on the type an arguments (known to the language or to the run-time support). In this case, 'building the type of an object into names' simply complicates and minimizes abstraction."

  • Joel Spolsky (for Apps Hungarian):

    "If you read Simonyi's paper closely, what he was getting at was the same kind of naming convention as I used in my example above where we decided that us meant "unsafe string" and s meant "safe string." They're both of type string. The compiler won't help you if you assign one to the other and Intellisense won't tell you bupkis. But they are semantically different. They need to be interpreted differently and treated differently and some kind of conversion function will need to be called if you assign one to the other or you will have a runtime bug. If you're lucky. There's still a tremendous amount of value to Apps Hungarian, in that it increases collocation in code, which makes the code easier to read, write, debug, and maintain, and, most importantly, it makes wrong code look wrong."

  • Microsoft's Design Guidelines discourage developers from using Hungarian notation when they choose names for the elements in .NET Class Libraries, although it was common on prior Microsoft development platforms like Visual Basic 6 and earlier. These Design Guidelines are silent on the naming conventions for local variables inside functions.

Read more about this topic:  Hungarian Notation

Famous quotes containing the words notable and/or opinions:

    a notable prince that was called King John;
    And he ruled England with main and with might,
    For he did great wrong, and maintained little right.
    —Unknown. King John and the Abbot of Canterbury (l. 2–4)

    Of the opinions of philosophy I most gladly embrace those that are most solid, that is to say, most human and most our own; my opinions, in conformity with my conduct, are low and humble.
    Michel de Montaigne (1533–1592)