a built-in function
second, what is Object-oriented program design and why have it
Process-oriented program design is the core of process (pipeline thinking), the process is to solve the problem of the steps, process-oriented design is like a well-designed pipeline, consider when to deal with what things.
The advantages are: greatly reducing the complexity of the program
The disadvantage is: a set of pipeline or process is to solve a problem, the production line of soda can not produce a car, even if it can, also have to be big change, change a component, reaching.
Application scenario: Once you have completed a very rarely changed scenario, the notable examples are Linux kernel, git, and Apache HTTP server.
Object-oriented program design is the core of the object (God-like thinking), to understand what the object is, we must regard themselves as God, God in the eyes of the world exists in all things are objects, not exist can also be created. Object-oriented programming good for example, to design a journey to the east, the Tathagata to solve the problem is to pass the scriptures to the Eastern Earth Datang, the Tathagata thought to solve this problem requires four people: Tang's monk, Sha Monk, Pig Eight commandments, Monkey King, everyone has their own characteristics and skills (this is the concept of objects, Characteristics and skills corresponding to the object's data properties and method properties, but this is not fun, so the Tathagata arranged a group of ghosts and goblins, in order to prevent the four of them in the road of learning to be killed, and arranged a group of immortal escort, these are objects. Then the beginning of the lessons, master and disciple four people with ghosts and goblins to interact until the final canon. The Tathagata does not control the four people follow what process to take.
Object-oriented program design
The advantage is that it solves the extensibility of the program. A single modification of an object is immediately reflected in the entire system, such as the character of a character parameter in the game and the ability to modify it easily.
Cons: Poor controllability, inability to process-oriented programming pipelining can accurately predict the problem of the processing process and results, the object-oriented program once started by the interaction between the object to solve the problem, even God can not predict the end result. So we often see a game of people changes in a certain parameter is likely to lead to the ability of the bully to appear, a knife to kill 3 people, the game is out of balance.
Application scenario: frequently changing requirements of the software, the general needs of the changes are concentrated in the user layer, Internet applications, enterprise internal software, games, etc. are the object-oriented programming of the good place
Object-oriented programming is not all. For a software quality, object-oriented programming is just to solve extensibility.
Design-oriented Example: application: Grep-rl ' root '/etc
Python (10)