MANAGING AND REDUCING COMPLEXITY AND PROGRAM PROCESSING |
Three techniques:
A good programming language supports all three!
PROBLEM DECOMPOSITION Divide and conquer (divide et impera). Problem decomposition hinges on procedures, recursion and parameter passing, and can be applied in most (high level) programming languages.
ABSTRACTION Ignoring irrelevant detail in a safe way (information hiding).Requires the use of an “interface” to abstract away from lower level detail.To do this safely users should have no choice but to abstract away. Abstraction is typically facilitated through the use of packages or modules.
CONTEXTUAL CHECKING Contextual checking is concerned with the contextual correctness of program code. Ideally we would like to check for (and eradicate) all possible “run time” errors, however contextual checking is a difficult undertaking and in some cases (e.g. recursion) completely impractical. Contextual checking consists (typically) of parameter and identifier validation.
A program written in a high level language (source code) can only be run in its machine code equivalent format. There are two ways of achieving this:
INTERPRETATION: Interpretation requires the use of a special program that reads and reacts to source code. Such a program is called an interpreter. During interpretation run-time errors may be detected and “meaningful” error messages produced.
COMPILATION: Compilation requires the use of a special program (called a compiler) that translates source code into object code. The object code itself cannot be executed. To do this various library files (see below) must be “linked” in using another special program called a linker. The linker then produces executable code. Again various contextual checks are made during compilation.
NOTE ON LIBRARIES: Libraries (in computer programming terms) contain chunks of precompiled (object) code for various functions and procedures that come with a programming language that requires compilation. For example functions and procedures to facilitate I/O.
COMPARISON:
|
A macro comprises a name and a string. During Macro preprocessing all occurrences of the name within the program are replaced by the string before interpretation/compilation takes place. Use of macros offers the advantage of enhanced readability. However it is also argued that a well designed language should not require the use of macros.
To assist in error detection many debugging tools exist. Some of these allow the user to anlayse the core dump that occurs\in the event of a fatal error. (A core dump describes the “state” of a program when a fatal error occurs). Others allow programmers to step through and execute a program line by line to support analysis of this execution. Overall modern debugging is still in a very unsatisfactory state of development.
PROGRAM MANAGEMENT SYSTEMS Program development comprises a code writing (using a text editor) compilation loop as the programmer attempts to eradicate all detected errors. In a large program, comprising many modules, it makes sense to recompile only those modules that have been changed. The job of a program manager is to monitor which modules require recompilation. The management system is usually integrated with the linker.
PROGRAMMING ENVIRONMENTS To further reduce this development time some vendors have combined a text editor with a compiler/interpreter into a single dedicated programming environment for the production of code in a particular programming language. Such environments include a program management systems and other "administrative" tools (e.g. version control).
Return to introduction home page.
Created and maintained by Frans Coenen. Last updated 03 July 2001