Section 8 - Program Implementation
Section 8 - Program Implementation
PROGRAM IMPLEMENTATION
1
Distinguish between low-level
and high- level programming
languages;
Computer Program
4GLs
(4th Generation)
Disadvantages:
• Difficult to read, write and understand by humans as the programs
involve only 0’s and 1s
• Machine dependent, so unable to be used on another machine
• Difficult to modify or correct mistakes
Second Generation Language
The second generation language called assembly language;
instructions are written using mnemonics or abbreviated forms of
word.
Example it uses words like ADD for addition and SUB for subtraction.
Disadvantages:
• Slower in execution than machine-level languages
• Still machine dependent
Third Generation Language
Third generation languages (3GLs) use statements in English that are
easy for programmers to use.
Advantages:
• Easier to read, write and understand than low level languages
• Easier to modify or correct mistakes than low level languages.
• Machine independent
Disadvantages:
• Slower in execution than low level languages because it has to be
Fourth Generation Language
Fourth generation languages (4GLs) are considered advanced
high-level languages.
Advantage:
• useful for generating reports
Disadvantage:
• can become very wordy
Fifth Generation Language
Fifth generation languages (5GLs) instructions are used in a
conversational way so it is also called natural language programming.
5GL are designed to make the computer solve the problem to you.
It only require the programmer to write the goals that have to be achieved
and not the sequence of steps to solve a problem. The computer would
solve the problem – it works out the required steps.
5GLs are used in artificial intelligence where computers are given qualities of
a human.
Fifth Generation Language
Prolog and Mercury are fifth generation languages.
Debugging - the finding and correcting of errors that exist in your program.
Types of Errors
Syntax error -an error caused by incorrect use of a language violating the rules
governing the structure of it. These errors are found during compilation. It may be
the misspelling of a word or the opening of a command without closing it.
Logic errors – is when the program does not produce the required results due to
incorrect logic. This error cannot be detected by the compiler, it can be detected
when the program is run; using appropriate test data and the actual output doesn't
match the required output. Logic errors are usually the hardest to debug because
they do not cause the program to fail completely.
Run-time error – occurs when the program has to terminate before its completion.
Such as division by 0.
6
Effectively document
programs.
It is important to have
clear documentation of
your program so that
others can follow it
easily, whether they are
other programmers or
users of the program.
Internal documentation – appears inside the
program
• meaningful variable names
• descriptive comments
• indentation
• effective use of white space
External documentation – is created separately and supplied with the
program
• Technical documentation – contains the technical aspects of the
program such as version, the operating system that it can work with, the
amount of memory and hard disk space required and installation
procedure
• User documentation (user manual) – suggest how the users should
use the program to solve some simple program errors; it contains
instructions on how to start and stop the program and using the program.
Can be in the form of a written booklet or online tutorial with FAQs
(Frequently Asked Questions)