Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Hungarian notation
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Advantages== (Some of these apply to Systems Hungarian only.) Supporters argue that the benefits of Hungarian Notation include:<ref name="simonyi" /> * The symbol type can be seen from its name. This is useful when looking at the code outside an integrated development environment — like on a code review or printout — or when the symbol declaration is in another file from the point of use, such as a function. * In a language that uses [[dynamic typing]] or that is untyped, the decorations that refer to types cease to be redundant. In such languages variables are typically not declared as holding a particular type of data, so the only clue as to what operations can be done on it are hints given by the programmer, such as a variable naming scheme, documentation and comments. As mentioned above, Hungarian Notation expanded in such a language ([[BCPL]]). * The formatting of variable names may simplify some aspects of [[code refactoring]] (while making other aspects more error-prone). * Multiple variables with similar semantics can be used in a block of code: dwWidth, iWidth, fWidth, dWidth. * Variable names can be easy to remember from knowing just their types. * It leads to more consistent variable names. * Inappropriate type casting and operations using incompatible types can be detected easily while reading code. * In complex programs with many global objects (VB/Delphi Forms), having a basic prefix notation can ease the work of finding the component inside of the editor. For example, searching for the string <code>btn</code> might find all the Button objects. * Applying Hungarian notation in a narrower way, such as applying only for [[Member variable|member variables]], helps avoid [[naming collision]]. * Printed code is more clear to the reader in case of datatypes, type conversions, assignments, truncations, etc.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Hungarian notation
(section)
Add topic