You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hungrian notation should be added to the list of notations in the docs/lexicon page.
Hungarian notation resembles "camelCase" and "PascalCase" with the exception that it has a prefix that denotes some additional semantic meaning (usually data type). For example:
pContractor is a pointer that points to a Contractor object.
bEmployed is a boolean representing whether someone is employed or not.
fHourlyPayRate is a float representing the amount a contractor is paid per hour.
Hungarian notation can be extended to include the scope that the variable exists within. For example:
m_iDaysWorked represents the number of days someone has worked for, that is stored as an integer and whose value is a member (meaning: is independent for each instance) of a class, in this case of contractor.
s_iNumberOfOpenContractorPositions represents the total number of contractor positions available, stored as an integer. Since this value would be the same for all instances of the contractor class, it is declared and assigned statically on the contractor class itself.
Personal note: While hungarian notation is falling out of use thanks to more modern development environments and tooling, it is still prevelent in many older and/or larger projects. It is also worth being aware about to prevent confusion among developers from different backgrounds. For instance:
Programmer A creates a variable called iHaveCompletedCourse, and commits the code to a project. Some time later, Programmer B tries to use or updates the variable iHaveCompletedCourse and ends up encountering errors. Now they have to spend time trying to determine why a variable they think is an integer, is not accepting an integer value when in fact it was a boolean and the "i" is in fact refering to whether the user themselves have completed a course or not.
The text was updated successfully, but these errors were encountered:
Hungrian notation should be added to the list of notations in the docs/lexicon page.
Hungarian notation resembles "camelCase" and "PascalCase" with the exception that it has a prefix that denotes some additional semantic meaning (usually data type). For example:
pContractor
is a pointer that points to a Contractor object.bEmployed
is a boolean representing whether someone is employed or not.fHourlyPayRate
is a float representing the amount a contractor is paid per hour.Hungarian notation can be extended to include the scope that the variable exists within. For example:
m_iDaysWorked
represents the number of days someone has worked for, that is stored as an integer and whose value is a member (meaning: is independent for each instance) of a class, in this case of contractor.s_iNumberOfOpenContractorPositions
represents the total number of contractor positions available, stored as an integer. Since this value would be the same for all instances of the contractor class, it is declared and assigned statically on the contractor class itself.More info: https://en.wikipedia.org/wiki/Hungarian_notation.
Personal note: While hungarian notation is falling out of use thanks to more modern development environments and tooling, it is still prevelent in many older and/or larger projects. It is also worth being aware about to prevent confusion among developers from different backgrounds. For instance:
Programmer A creates a variable called
iHaveCompletedCourse
, and commits the code to a project. Some time later, Programmer B tries to use or updates the variableiHaveCompletedCourse
and ends up encountering errors. Now they have to spend time trying to determine why a variable they think is an integer, is not accepting an integer value when in fact it was a boolean and the "i" is in fact refering to whether the user themselves have completed a course or not.The text was updated successfully, but these errors were encountered: