Sometimes it is not appropriate to abstract the desired function into a class, it can only be implemented in a process-oriented way (even if there is no way to integrate into a function), then how to do it? Will the habit of "let the code run as expected and refactor later" negatively affect the future?
Reply content:
No, because it is impossible to learn so early. Learn to write code before you get to object oriented. Of course, this is not to let you do not use class, anyway beginners casually use, more use of excrement, after the best practice will understand more profound. In order to solve the problem to Oo is the right thinking, in order to Oo to oo that is sick, hopeless do not need, first of all, not all problems are suitable for the object-oriented solution, and then for beginners, the consolidation of the foundation is more important; If you want to learn to object-oriented, you might as well have done before the practice of the object
Follow my "Node Flash" column, 15 minutes to get started with a node/front-end skill that provides all the source code. Not everything has to be a class, object-oriented is just a way of doing things. If you really want to Oo Oo, a small program can be written very large, and there is no egg, because the class too much redundancy, is still not good maintenance.
Again, many times you can only "write to let code to run" This step, refactoring is still far away, a lot of projects probably even the opportunity to reconstruct is not round. The road of sword, need to view each family sword, from the complex into Jane, from out of the most general jurisprudence, to form their own understanding of the sword.
Then need to be simple into the complex, the general legal arrangement of the combination of the formation of their own sword.
The way of programming is also the first to have an object, and then to write to her code to write more, and so you back to use the framework (QT,WPF ... ), will read the mantra, and then learn these good framework of packaging ideas, at least the factory model you can learn.
I study c when each of the data structure of each algorithm to write their own, and then learned c++,java,c# later found that these things can have ready-made and used up so convenient, and then naturally learned to object-oriented. Process-oriented writing for processes.
After all, you are a beginner, do not know how to object-oriented.
At least it can be tolerated.