The Hungarian naming convention is a naming convention for programming. The basic principle is:
Variable name = property + Type + Object Description
Each object name must have a clear meaning. The full name or part of the object name can be used. The name must be based onEasy to remember and easy to understand. Guaranteed nameCoherenceVery important. The following are common naming rules for Hungary:
For example, if the form is named form, the Hungarian naming method can be abbreviated as frm. When the form variable name is switchboard, the full name of the variable should be frmswitchboard. In this way, it is easy to see from the variable name that switch is a form. Similarly, if the variable type is label, you should name it lblswitchboard.
You do not need to keep these naming rules in mind, but it is very useful to understand these rules.Good Programming habits are the first step to become a programmer.. It is necessary to use a standardized naming method and make it understandable to everyone. For example, we can see a gbflag variable, which can be easily understood as a global Boolean state variable.
You do not need to use Pinyin as the variable name. When programming, open an EnglishElectronic DictionaryFor example, youdao dictionary and Google translation, even if the words used are not appropriate, it does not matter. Pay attention to the singular and plural numbers. If a few words constitute a variable name, you can make the first letter of each word uppercase, for example, allbullets-all bullets.
What you can understand and guessAbbreviations. For example, bitmap can be abbreviated to BMP, source can be abbreviated to SRC, and so on.