Structured programming
• Structured programming, is a methodology of
coding programs that uses a restricted set of
constructs that are simple, safe and powerful in
controlling the flow of execution of a set of
instructions.
• These three constructs are the sequencing,
selection and repetition.
Program
• This is a complete set of step-by-step instructions
that control and direct the computer hardware in
carrying out a given task. Tasks may vary from
very simple e.g. computing surface area to
complex ones like statistical analysis.
• Programs are usually written to solve user
problems on a computer.
Programming Language
• A programming language is a system of notation for
writing computer programs. Programming languages
are described in terms of their syntax and semantics,
usually defined by a formal language.
Syntax
• These are the rules of a language that govern the ways
in which words, symbols, expressions and statements
may be formed and combined in that language.
Semantics
• These are the rules of language that govern
meaning of statements in any language.
Programmer
• This is a person who is trained and/or specializes
in the technique of creating, maintaining and
modifying computer programs.
Types of Structured Programming Language.
• Pascal
•C
• Fortran
• COBOL
• LOGO
• LISP
History of Programming Languages
• A program can be written in a variety of
programming languages. The languages can
broadly be classified into two categories:
• Low-level language – which refers to the machine
language and assembly language.
• High-Level languages: - which refers to
languages such as COBOL, FORTRAN, BASIC
LOW LEVEL LANGUAGES
• Machine Language (First Generation Language)
• Digital computers represent and process data and
instructions as binary numbers. This representation of
instructions and data is called machine language.
Program instructions were written as a series of binary
digits (0’s and 1’s). When the program was entered into
the computer execution was direct since machine
language needs no translation. The binary combination
allowed the program to have full access to and control
the computers internal circuitry and memory addresses.
Advantages
• Program translation was fast because no
conversion was required.
• The program could directly address and control
the internal circuitry meaning that these programs
were more effective in hardware usage and
control.
Disadvantages
• Writing programs was time consuming
• Tracing errors in a program was extremely difficult.
• Difficult to learn and use.
• Program modification was cumbersome.
• They were machine dependent i.e. a program created for one
type of machine would not work on a different type of
machine.
• To write an effective program the programmer had to have
expert knowledge on the computer’s internal workings.
Assembly Language (Second Generation)
•
This language was more user oriented than
machine language. Instructions are
represented using mnemonic code and
symbolic addresses. Words like add, sum
etc could be used in programs. An
assembler translated these codes into
machine language.
Advantages
• Much easier to learn compared to machine language.
• Coding took less time than coding using machine
language.
• Error correction was less cumbersome.
Disadvantages
• Were also machine specific
• Execution took longer than machine language
programs due to translation process.
HIGH LEVEL LANGUAGES
• These languages are user friendly and problem
oriented compared to the low level languages.
Programs written in high level languages are shorter
than the machine language programs.
• They have an extensive vocabulary of words and
symbols therefore program instructions are written
using familiar English-like statements and
mathematical statements.
• A single high-level language program is translated
into multiple machine code instructions.
Advantages
• They are portable i.e. they can be used on
more than one type of machine.
• Creating program and error correction takes
less time.
• Are relatively easy to learn and use.
• The programmer does not have to be an
expert on the internal workings of the
machine.
Disadvantages
•Program execution takes more time due
to the translation process.
•They do not address the internal circuitry
of computers as effectively as the low
level languages.
•A translated program will occupy more
space.
High level languages can further be classified
into :
•Procedural languages (Third Generation)
•Non-Procedural Languages (Fourth
Generation Languages or 4GLs)
Procedural languages (Third Generation).
• They require the programmer to specify
step-by-step how the computer will
accomplish a specific task. Program
execution follows the exact sequence laid
down by the programmer during coding.
Examples include FORTRAN, PASCAL,
BASIC,
Non-Procedural Languages (Fourth Generation Languages or
4GLs).
• They allow the programmer to specify the desired result
without having to specify the detailed procedure needed to
achieve the result.
• They are more user oriented and allow programmers to
develop programs with fewer commands compared with 3rd
generation languages. They consist of report generators,
Query Language and Application generators.
Object Oriented Programming Languages
•a computer programming
model that organizes software
design around data, or objects,
rather than functions and logic
Fifth-generation programming language
• Programming languages that are designed to make
the computer to solve the problem for the
programmer by the computer depicting human
like intelligence thus helping the programmer not
to spend a lot of time to come up with a solution
but only worry of the problem to be solved and the
conditions to be met.