Programming methods, Algorithmic programming, Structured...

Programming Methods

Algorithmic Programming

In algorithmic programming, the program is divided into a sequence of modules, each of which performs one or more actions. In this case, the work of the module must always begin with the execution of the first command, and end with the most recent one, i.e. You can not get to the internal commands of the module from the outside or transfer control from the internal commands of the module to external commands (bypassing the latter). In the chosen programming language, the algorithm is written using data description commands, calculating values, and controlling the sequence of program execution.

Structured Programming

is based on subroutines [7]. The subroutine is a part of the program in the form of a set of statements that perform the desired action and are not dependent on other parts of the source code. At the same time, the structure of the program reflects the structure of the problem being solved. The algorithm of its solution is visible from the source text, which consists of a sequence of completed blocks of code that have a certain semantic load. Subroutines are, in fact, new operators or language operations, defined by the programmer. You can refer to them by their names and call them in any order. A programming language with subroutines is assigned to a class of procedural languages.

Descending design. Using the procedural language allows you to allocate subprograms for the main stages (data initialization, task solution and completion) while developing the application, then each of these modules a lower level, dividing them into a small number of other subprograms, etc. Thus, subroutines allow the use of an approach called top-down design, i.e. to design and develop the application from top to bottom.

Event-oriented programming is based on the use of:

• user events triggered by user actions;

• System events that occur in the operating system (for example, caused by messages from the timer);

• program events generated by the program itself (for example, a detected error that requires processing).

Event programming creates a program with the following structure:

• The main part of the program, which is a single infinite loop, following the appearance of a new message from the specified list by polling (for example, the Windows operating system);

• when a message is found, a subroutine is called, the message is processed and the polling cycle continues until the message "Quit Job" is displayed.

Event programming is a development of top-down design, as it allows not only to order the structure of the program, but also to define and detail the program's response to various events. With the spread of the Windows system and the appearance of visual RAD-environments, it has become widespread.

The technology of structured programming. Complex programs in high-level language, including descriptions of data types, variables and constants, require structuring. Their most important components are the procedures and functions (or subroutines) that ensure the structuring of programs at the source level. In this case, some parts of the algorithms are processed in the form of procedures and their subsequent invocation. All necessary connections between formal and actual parameters of procedures are established by the translator of the programming language used. One technique for dividing the source code of a program into separate parts is to insert special expressions into the text of the main program, indicating to the compiler the need to include the text of other modules in it. Another approach to building large programs is to compile individual modules that are broadcast completely independently of each other and communicate at the stage of final formation of the executable program in the machine codes.

As a result of the compilation of individual text modules, so-called object modules are created. Each object module is stored in a special file with the extension .OBJ. The collection of individual object modules is converted to a boot file of type .EXE or .COM. This transformation is called binding of object modules and is implemented by the linker, or linker, which is a system program LINK. When accessing LINK, all object modules that must be combined into a common program, as well as the file name with the resulting program, the file name with the listing (optional parameter), and the file name with the library of procedures are specified.

One way of forming independent parts of the program is to create libraries of object modules using the LIB program. This program also allows replenishing the old library with procedures that are extracted from pre-translated object modules or from another library. Each programming system usually has its own library of standard procedures/functions. At the stage of assembly, object modules are included in the task (program) being formed. Files with libraries are specified when accessing the linker of LINK programs.

The entire translation process consists, in general, of four stages:

• the formation of text modules (using text substitution);

• parsing and outputting errors found by the translator in the text of the program;

• generation of object modules in machine codes, optimization;

• assembly of object modules of executable program code.

Most translators have several phases (passages) designed to perform specific work on the full text of the program. In addition to the phase of syntactic analysis and the generation of object modules, the optimization phase is often highlighted.

Thanks to separate compilation, programs become more convenient for analysis and modification, it becomes possible for several programmers to participate in the development of one system, and also to assemble programs from modules written in different programming languages, provided that methods for transferring and processing parameters of procedures and functions.

With the structuring method discussed, the resulting executable program code is a single file. In a number of cases, it becomes necessary to divide programs into parts (segments) that could be permanently stored in external memory and loaded into RAM only as needed.

One of the common methods of this division of programs into parts is based on creating overlapping (overlay) segments. One of the segments (root) is constantly in the RAM, the rest - in the external disk memory. When an overlay segment is in demand, it is loaded into RAM from external memory. In this case, all the links between the parts of the root segment and the newly loaded segment look as if they made up a single program from the very beginning.

thematic pictures

Also We Can Offer!

Other services that we offer

If you don’t see the necessary subject, paper type, or topic in our list of available services and examples, don’t worry! We have a number of other academic disciplines to suit the needs of anyone who visits this website looking for help.

How to ...

We made your life easier with putting together a big number of articles and guidelines on how to plan and write different types of assignments (Essay, Research Paper, Dissertation etc)