Say goodbye to idealism, go to empirical

zhaozj2021-02-16  31

Everything starts from Structual Programming VS Object-Oriented Program. Where is the most differential difference between structured programming and object-oriented programming? From history, they almost start at the same time (or even structured in the application field is also leading OO), it can be confident that they are still in the same level, knowing to two different programming methods. (Programming here is not only coding, but refers to software engineering life-cycle). The biggest difference Where do I think it is a different perspective. Excellent structured "objects" as a module, the data and operations in these modules are separated, but the module is made, and there is a certain package and abstraction. Previously, I can implement OO programming with c, now I think about it, because the object-oriented features are in essentially a whole. Structured does also implement data and operation packages, but That is coupled, it is not reused. For example, I use the structure to represent an "object", you know that the interface is pure data (field), then define several methods to operate the structure (and put the structure as a parameter of the structure) I felt very flexible, because if I want to expand which "object", only the structure is slightly modified, but the result of the programming is exactly the way that is very embarrassing, because they are tight by this structure. It is difficult to extend to other similar structures. So the previously defined structures are not object-oriented, at least very strong. Summarize previous errors, it can be seen that there is no need to use OO's view to apply Structured field. The package is characterized by each other. Programming is used to solve practical problems, all consolidations should be feedback from the problem space. The problem space is diverse, sometimes you need to put Data and operation binding, sometimes it may not need it. The above words means that from our learning programming experience, most of them are structured, then to oo, this transition process is easy to produce one Misunderstanding, that is, OO is from structured optimization (so-called Youth is blue), OO is always stronger than structured. Now, I want to emphasize their equality, then explain what I think is the most significant The superiority. As long as possible, the problem space is diverse, in addition, it still changes, how to deal with changes, or how to use the smallest price to deal with changes. Quote a common principle is "discovered changes, encapsulation changes "In structure, to encapsulate new changes, we are likely to write a new method or new module, so much change, Li Tie can't stand. And in OO, we use one Interfaces to encapsulate changes, on this interface, achieve various changes (ie, all semantic subclasses with interfaces), our operations should be facing this The details of the mouth have hidden the details of the change (no need to program a variety of changes). There are many similar examples. Experts-oriented experts are very good at writing similar "myths", but it is not my words, just happened. In our side, I have been thinking about it. I have been thinking, why there are so many advantages for objects, but it is mainstream until the 190s. Maybe, humans need more abstraction to get it, maybe he is easy to use Still need to be investigated. When you don't understand OO, I really like that myself is an oo-programmer, but when I seem to understand it, I only hope to make a free Programmer. The problem facing the software industry is not an emerging technology. Solved, it is not an object-oriented to solve, not a separate software project can be solved. Whether it is Programmer, or Architect,

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

New Post(0)