FAQ – Language Types

Description and comparison of

  • procedural
  • declarative
  • event-driven languages

Imperative languages are also known as procedural languages because they employ structures which include procedures and functions. Programs generated in procedural languages involve a sequence of operations and are often described as linear programs.
A procedural (imperative) programming language tells the computer how to do something, written as an ordered sequence of steps that describe exactly what it must do at each step. These instructions, which form the basis of an algorithm, are followed in written order by the computer.
Three basic constructs are used to define the order of the steps:
1. sequence (the logical ordering of steps);
2. selection (a step or sequence of steps are performed if a condition or set of conditions is true);
3. iteration (a step or sequence of steps are carried out repeatedly).
Both iteration and selection are control constructs because they can alter the flow of control of program execution. You will see more of this in later topics.
Examples of imperative languages are Algol, Fortran, Pascal, Basic, C and COBOL.

Declarative languages or Logical languages model problem solutions very differently. Programmers specify what the problem is rather than how to solve it. In PROLOG, for example, a program represents propositional knowledge as facts and uses rules to test facts, building more complex propositions. Collectively facts and rules are called clauses. A proposition is the smallest unit of knowledge that can be judged true or false, such as “a collie is a sheepdog”, or “a beagle is a hound” or  “George passed a ball to Steven”.

Contrast this with a procedural language where the programmer would need to set up a structure to hold the knowledge and predefine its type (string, number etc). Then they would need to describe the steps taken to search the structure in order to answer the query. A declarative/logical language is simplistically described as telling the computer what to do and not how to do it.


Event driven programming languages have evolved to handle events. Events can be initiated at two levels:

1. at system/hardware level: events can include timers, interrupts, loading of files etc;

2. at language/system level: events involve mouse clicks, keyboard presses and cursor movements.

In Visual Basic each object has a set of events. Here an event is an action that Visual Basic can detect and respond to by a user clicking on a command button, After each event is handled, nothing happens until the next event occurs. Note that event-driven programs do not have a predefined pathway in the execution of the code, as opposed to imperative programming style i.e. they have no beginning or end. Graphical user interface programs are typically programmed in an event-driven style using languages such as Visual Basic and Visual C


A Scripting language is a style of ’programming’ that produces ASCII text-based scripts which are usually designed for writing small programs like batch files. Scripting languages support high level language control features such as selection and iteration (syntax) but they are not considered programming languages as such. Examples of present day scripting languages are VBScript, JavaScript, Perl, Python, TCL (Tool Command Language) etc Applications that provide scripting capability allows the user to extend the functionality of the application by programming a sequence of actions. For example, in Filemaker Pro (a database package) it is possible to write scripts that open and close files, copy data from records or enter a certain database mode such as browse or find.