How do small white programmers write high-quality code from quantitative change to qualitative change? Many veteran programmers have been in development for years, and there is a feeling that looking at the source code of open source projects such as Spring and Apache Common is a pleasure for two reasons:
1. Very high code quality;
2, naming special specification;
To write high-quality code is not an easy thing, requires years of practice, is a quantitative to qualitative change process, but to write good naming, only need a good foundation of English grammar and a sense of self can easily achieve.
1. Do not use meaningless English letters for names.
2. Don’t use pinyin, or even pinyin initials.
3. English must be used, and the use of accurate English, both spelling and grammar, nouns must be singular, such as Account, Customer.
The names of arrays, lists and other object collections must be plural, and it is better to use accurate plural forms according to the basic English grammar knowledge, such as List Account accounts, Set Strategy Strategies. For Boolean properties, many developers use isXXX, such as isClose.
4. The method name should be “verb-object phrase” or “is a verb + a predicate phrase”.
5. For the common “add, delete, change, check” method, the best name to be careful.
6. Prefer long method names to obscure abbreviations.