Meaningful naming
1. Variables, constants and functions should be known by their names rather than meaningless or misleading names. 2, try to use complete English words to name, so that it is easy to search, but also can express semantics. 3. Use verbs for method names and nouns for attributes to be clear at a glance.
function
1, the function only does one thing, so how do you tell if a function only does one thing? Whether a function does something at the same level, or whether it can be separated from another function.