C ++ programming model

zhaozj2021-02-16  62

PW: It doesn't know what it means. This article has been seen before. Later, I did it, even if I collected it.

The computer language programming has been in the mid-1950s. After nearly half a century, in which countless setbacks, more gratifying is a major progress in the development of language, which has developed 4 medium designs, and the development of computers. There is a glorious page in history. I. Process programming: Determine which procedures you need, use the best algorithms you can find. It is concerned that the computer's processing process, at this stage, algorithm is the most important, not only because of this model of design, there is also the restrictions on the research conditions at the time, CPU, memory is less pitiful, one algorithm The quality directly affects the final quality of the program. The language of this model (of course, the language at the time) is a function-centric, and various algorithms are written through function calls and other language functions, so the function is treated in an algorithm maze. An order to establish it. Since the design model is like this, it has enabled people to study various algorithms, there have been many very classic algorithms (perhaps more stable, the algorithm has caused this model of design), for example: 1 1946 Los Alamos Von Neumann, Stan VLAM, Nick Metropolis Metropolis Algorithm, Monte Carlo Method 2,1947 Langd's Grmber Dantzig created linear planned simple algorithm 3,1950 Numerical Analysis of the National Standards Bureau MAGNUS HESTENES, EDWARD Stiefel, Cornelius Lanczos Krylovz Space Iterative Law 4,1951 Oak Ridge National Lab Alston HouseHolder Matrix Calculation Method 5,1951 John Backus Developed in IBM Leadership Fortron Optimal Compiler 6,1959- 61 London's Ferranti Ltd's JGffrancis called QR Computer emoticity of the algorithm of the algorithm, the stable method of the Method 7,1962 London's Elliot Brothers Ltd's Tony Hoare proposed fast (by size) classification 5,1965 IBM Cooley Princeton and Bell Turkey's FFT algorithm can be said, this is the rise of this model, and will emerge in such a wonderful algorithm. There are very few classic algorithms to produce (of course, but not so much. " ). Second, the modular programming: Determine which modules you need; divide the program into some corresponding modules, so that the data is hidden in the module. In the subsequent era, the focus of the program design reveals the transfer: from process design to organizations for data. This transfer also reflects the growth of the scale, and also implies the emergence of software factories. The module is simple to say is a set of processes and data packages, which is a widely known "data hidden principle". In some small programs or those who don't need to process related to data-related processes, it has been more than enough, but a better technology ---- modular design, since it appears, it will receive attention This is a relatively simple labore, which is relatively simple, and the design ideas are also clearer. Comparable modular design methods are: (1) Name Space / Structure. This is a way to meet the purpose of information hiding, so the names of functions, types, etc. can be easily made. (2) Header file and implementation of file separation. In this way, we can separate declarations and achievements, on the one hand, hide the implementation part of the user, and on the other hand, it provides an optimized means for recombinations. The implementation of this method is a very important concept - compiles separately.

Strictly speaking, the use of compilation is not the problem to be considered, but about how to best utilize the advantages of specific language implementation. Of course, the best way is to maximize modularization, representing modularity through language feature, and then physically utilizing this modular mechanism through a set of files that can be compiled most efficiently. (3) User definition type. At this time, you have to care about what data types you need, and then package them. In actual applications, this way is widely used, such as classes, but there is no actual class. The introduction of the modular programming, which leads to exception processing. It is also based on these modules for errors. As time, the various libraries are widely used, so that the standardized way As required, the abnormal processing will be delivered. Third, object-oriented programming (OOP): Determine which classes you need, provide a complete set of operations for each class, using inheritance to clearly explicit commonality. Object-oriented, this is a concept that everyone is very familiar, but what is object-oriented? You ask 10 people, there will be 15 answers. Object-oriented must include those features? There is no doubt that inherits, and polymorphism is definitely to be selected. The key is what is else. Package? template? abnormal? No matter which one has a considerable part of the loyal supporter. These we have no need to argue, the key is what the object is there, um, this is much more, you can refer to Booch's "object-oriented analysis and design". Object Concepts have a great advantage for software solutions, especially in the case of excellent design and reasonable. You can write only one code and repeatedly reuse in the future, and in the case of non-OOP, you should repeatedly write the same functional code multiple times in each part of the application. So, because the object-oriented programming has reduced the total amount of writing code, it has accelerated the progress of the development and reduces the amount of error in the software. The code used to create an object is also possible for multiple applications. For example, your team can write a set of standard classes to calculate your available resources, then use these codes to create objects in all solutions that need similar objects, such as customer order interface, stock value report, and sending a team notice and many more. Another advantage of OOP is the impact on the code structure. Object-oriented concepts like inheritance facilitate the development process of software by simplifying variables and functions. OOP can be more easily divided between the team between the team. At the same time, due to the use of OOP, the attachment of identification subclays has become more simple (such as the code of the inheritance object). In addition, software testing and debugging can also be greatly simplified. But OOP also has some inherent shortcomings. If a class is modified, all the code that relies on this class must retest, and may also need to re-modify the change of the class. Also, if the document has not been carefully maintained, then it's hard to determine which code uses a parent class (inherited code). If the buffer in the software is found in the later period, it may affect the quite number of code in the application. Object-oriented programming is different from traditional development in programming ideas, requires developers to transform the inertial thinking of traditional development. For an experienced OOP development team, the benefits of using OOP are obvious. If you are considering turning OOP, you must guarantee that you have experienced experienced primary developers can check the defects and architectures in the software. Fourth, the model program design: Determine which algorithms you need, parameterize them. Using class and class hierarchical mechanisms, we can express a single concept, and can express multiple concepts associated with each other in a hierarchical system.

转载请注明原文地址:https://www.9cbs.com/read-23900.html

New Post(0)