Sunday 20 November 2011

What is Hungarian notation, and should I use it? in C programming

What is Hungarian notation, and should I use it?

Hungarian notation was originally created by Microsoft programmer Charles Simonyi (no doubt of Hungarian descent). With this notation, the names of your variables or functions are prefixed with one or two characters that represent the data type of the variable or function.

This kind of notation has many advantages. It is used extensively in environments such as Microsoft Windows. See FAQ XIX.2 for a full explanation of Hungarian notation and some example notation standards you might want to adopt.

Cross Reference:

XIX.1: Should the underscore be used in variable names?
XIX.2: Can a variable’s name be used to indicate its data type?
XIX.5: What is camel notation?
XIX.6: Do longer variable names affect the speed, executable size, or efficiency of a program?
XIX.9: How many letters long should variable names be? What is the ANSI standard for significance?

No comments:

Post a Comment