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:

    In one notable instance, where the United States Army and a hundred years of persuasion failed, a highway has succeeded. The Seminole Indians surrendered to the Tamiami Trail. From the Everglades the remnants of this race emerged, soon after the trail was built, to set up their palm-thatched villages along the road and to hoist tribal flags as a lure to passing motorists.
    —For the State of Florida, U.S. public relief program (1935-1943)

    There can be no two opinions as to what a highbrow is. He is the man or woman of thoroughbred intelligence who rides his mind at a gallop across country in pursuit of an idea.
    Virginia Woolf (1882–1941)