Author of this section: Classic member noahgenius
1、Custom component library management
It is recommended to use folder classification. The biggest category should be functional modules, such as navigation, creating navigation folders, and there is a second-level classification in the folder. I follow pictures, buttons (including MC buttons), MC, MC of associated classes, and main scene MC (that is, it can be used by other modules, such as interfaces in Interface). There is also a common function module, which is a common component that can be used for components, sound, video, etc.
2、Naming of methods
The naming of variables has been said by the author, I want to talk about the naming of functions. It is recommended to test the nomenclature of "camel". It is a verb-object structure from a grammatical point of view. For example, getMovieClipName(), four words, the first one is a verb, except for the first word, the first letter is capitalized. Such a naming is better to explain the purpose of the function.
3、Improve the granularity of the class and the single function of the class
There is no harm in writing more classes. The functions of classes are as single as possible. Don’t let a class do all kinds of irrelevant things, as later modifications will be very troublesome.
4、Interface-based OOP programming
Java requires that each class be equipped with an interface, but it doesn't have to be so exaggerated. However, this idea is worth learning from. Let the interface replace the specific implementation class and other classes. If there is an extension in the future, you only need to write another implementation class without modifying the code of the interaction part.
5、Design is more important than coding
It is absolutely impossible to write code as soon as you start. First, plan your system well, from large processes to small logical implementations, and try to be clear. This way you won't feel confused during the process.