Peruse SICP 3 : Modularity, Objects, and State

Modularity, Objects, and State

Why name it as Modularity, objects and State?
Because the logic of their relationship, is that, the Modularity is purpose, the Objects is methodology, and the State is the key point of implement that is different from the previous way which is Procedures.

The preceding chapters introduced the basic elements from which programs are made. We saw how primitive procedures and primitive data are combined to construct compound entities, and we learned that abstraction is vital in helping us to cope with the complexity of large systems.

This is what we have already had, of which, abstraction for complexity of large systems.

But these tools are not sufficient for designing programs.

Problem comes, which is, not good for designing.
Why?

Effective program synthesis also requires organizational principles that can guide us in formulating the overall design of a program. In particular, we need strategies to help us structure large systems so that they will be modular, that is, so that they can be divided “naturally” into coherent parts that can be separately developed and maintained.

A better feature for a good design, which is, can be divided.

One powerful design strategy, which is particularly appropriate to the construction of programs for modeling physical systems, is to base the structure of our programs on the structure of the system being modeled.

Simulate the physical world. why physical world? Because it is already runnable.

For each object in the system, we construct a corresponding computational object. For each system action, we define a symbolic operation in our computational model. Our hope in using this strategy is that extending the model to accommodate new objects or new actions will require no strategic changes to the program, only the addition of the new symbolic analogs of those objects or actions. If we have been successful in our system organization, then to add a new feature or debug an old one we will have to work on only a localized part of the system.

To a large extent, then, the way we organize a large program is dictated by our perception of the system to be modeled. In this chapter we will investigate two prominent organizational strategies arising from two rather different “world views” of the structure of systems. The first organizational strategy concentrates on objects, viewing a large system as a collection of distinct objects whose behaviors may change over time. An alternative organizational strategy concentrates on the streams of information that flow in the system, much as an electrical engineer views a signal-processing system.

Both the object-based approach and the stream-processing approach raise significant linguistic issues in programming. With objects, we must be concerned with how a computational object can change and yet maintain its identity. This will force us to abandon our old substitution model of computation (section 1.1.5) in favor of a more mechanistic but less theoretically tractable environment model of computation. The difficulties of dealing with objects, change, and identity are a fundamental consequence of the need to grapple with time in our computational models. These difficulties become even greater when we allow the possibility of concurrent execution of programs. The stream approach can be most fully exploited when we decouple simulated time in our model from the order of the events that take place in the computer during evaluation. We will accomplish this using a technique known as delayed evaluation. {{footnotes}}

 
0
Kudos
 
0
Kudos

Now read this

探索多巴胺

如何研究一个主题?通用视角是:通过学习资料,直到可以提出关键问题。而答案可以通过AI获得,本文的答案就是由deepseek生成。 关键问题列表: 1.多巴胺分泌(放电)的时候是什么感觉? 2.多巴胺导致的愉悦和单纯的快乐有什么区别? 3.多巴胺如何导致欲望感觉出现?是因为多巴胺降低导致还是因为多巴胺升高导致? 4.既然多巴胺分泌时候的愉悦感和单纯的快乐不一样,那么吸毒后的感觉只是愉悦感而非快乐吗? 5.既然单纯的快乐也是通过大脑分泌的内啡肽获得,... Continue →