Engineer. Path to IT

Ozhegova“A flow is a moving mass of something” and logic. That's better, obviously something is moving.

Now we know:movement of something – it means that something exists, since it exists, then, probably, it is the movement of something that is the subject, the unit of our consideration – the program (static code). But the program is not a flow, and the flow is not a program, it is its certainty, quality of condition this programs. That is, something that is outside this program, but is in direct connection with it. Let's think about what makes program in flow. It's easy. – is being fulfilled.

Execution, let us turn to the same dictionary, – to play in front of listeners, viewers, It would seem, what does this have to do with our case? The most direct: the program is an executor of a special genre, and having received the initial data, begins to execute the structural algorithm embedded in its architecture. And who is the viewer here? Any utility or process intended for its initialization and obtaining the result.

Means, program execution flow – this is the reproduction of the code embedded in the program structure with movement along it as a result of initialization by the parent process.

Let us express this, as agreed, in graphical form, where m[ ] — this is the current stage of movement along the structure (pic_5. The_model_program_execution_flow):

pic_5. The_model_program_execution_flow

pic_5. The_model_program_execution_flow

The flow highlighted in the visualization is for ease of perception; in fact, of course, it is also located inside the “program”.

m4 = output(m3) = task(m2) = input(m1)

This is where the essence of flow control comes from: simply by changing or replacing a function or condition at any stage, you can predictably change the result, i.e. control the program.

Well, of course, we enter a specific part into it, having already picked up the entire code and entered it into the program part of the structure (pic_6. the_model_program_execution_flow_example):

  pic_6. the_model_program_execution_flow_example

pic_6. the_model_program_execution_flow_example

The author worked for about two months to reach this simple structural model. For a beginner, this is not at all obvious, especially when perceiving simple one-dimensional structural diagrams and texts. Ours has two dimensions, i.e. visually we can clearly distinguish two measures:

• static code (program);

• dynamic code, flow (code execution at different stages m[ ]).

In general, structured programming is essentially easier to learn for a developer or student. All we need to do is strictly adhere to the architecture defined by the decomposition method and maintain a balance – so that there is no excessively detailed decomposition.

Level 1. “pic_7. the_model_program_execution_flow_example”

Level 1. “pic_7. the_model_program_execution_flow_example”

In the next article we will continue to get acquainted with the visualization of the C language, complex architecture.

The author is a member of School 21.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *