Section 16.2
High Level Programming
16.2 Language Classification
There are many languages designed to be used in solving particular problems.
16.2.2 Procedural Languages
They consist of a series of statements which act act on a given set of data.
Programs are usually designed in a top-down fashion.
There are two problems:
- If the structure of the data changes all the programs that use the data
must change.
- If the way the system function changes then program alterations will be
widespread.
16.2.3 Object Oriented Languages
Objects
An object is a data item with characteristics in common with other objects in
its class.
Inheritance
Classes of objects can inherit characteristics from a base class.
Such classes have their own extra characteristics and are known as derived
classes.
Encapsulation
Each object has its own functions and data. The data can only be accessed
through functions that belong to the object.
16.2.4 Event Driven Languages
In an event driven language a block of code is executed in response to an
event.
Examples of events:
- User clicks on an icon
- A key is pressed
- The pointer is moved over a picture
Event driven languages usually work with GUI
16.2.5 Declaritive Languages
Declaritive languages express problems in terms of structured objects and the
relationships between them.
Example:
male (joe_bloggs)
car (ferrari)
owns (joe_bloggs, ferrari)
A query can be entered:
? male (joe_bloggs)
output: Yes
This is a "what to do", not a "how to do" approach.