Answer 1.ii

Up Answer 1i Answer 1ii Answer 2 Answer 3

The Question

Some commentators prefer to describe the history of programming language development in terms of the evolution of "paradigms". Typically, four different paradigms are used to classify language types: imperative, functional, declarative and object-oriented. Explain and illustrate briefly how the concept of "programming language paradigm" has been used to distinguish types of programming language.

 

The Answer

In the history of programming there are various systems of ideas that have been used to guide the building of solutions to problems, and hence the design of programming languages. Since the 1950's when the first generation language was designed, different languages have been developed up to the present day, when fifth generation languages are now in widespread use. However the programming process has not developed on a linear scale, as suggested by the generation classification of programming, but has developed along several alternate paths.     There are four distinct approaches (or paradigms) that can be used to categorise the various types of programming languages:

·        Imperative

·       Functional

·        Declarative

·        Object-orientated

The procedural or imperative paradigm is the one on which a CPU's fetch-decode-execute cycle is based. It uses a programming process that follows a sequence of commands, that when executed manipulate data to produce a solution. Languages that reflect this paradigm recognise the fact that computers have re-useable memory that can change state. The imperative languages are the traditional approach to the programming process, as they are very similar to machine languages. They operate in a logical sequence of explicitly defined steps. Each step depends on, or executes, a condition or variable state.

Imperative languages include, Machine languages, Basic, C, Pascal, Cobol, Fortran, Algol, APL

In the
functional paradigm we express computation as the evaluation of mathematical functions. These are nested inside the language like black boxes, which accept input and produce output. The programmer must consider the required input and the functions needed to produce the desired output. He can then combine these basic functions to construct more elaborate functions. The order of execution of the functions depends on the output of the previous function.

Examples of functional languages are: LISP, MIL, Scheme.

Declarative paradigms are based on logical deduction, and require the programmer to develop an accurate and precise statement of the problem rather than discovering an algorithm for solving it. The idea is to implement a general algorithm, and combine it with the statement of the precise problem in the same algorithm format to solve the problem. A series of facts and rules are specified, and the order in which the instructions are executed depends on matching these rules and facts. The declarative approach has generally been used to simulate a system, in order to test a particular hypothesis. This is done by repeatedly running a function to simulate real time.

Examples of declarative paradigm languages are: PROLOG, GPSS.

In the Object-Oriented paradigm, units of data are viewed as active objects, instead of being merely a passive collection of data controlled by a program. These objects contain both data and the procedures for manipulating that data. Each object is implemented as a separate, well-defined unit of data and functions that can be reused each time the unit is required. This modular structure of this paradigm facilitates the "building block" approach to software development. This makes programs easier to write and modify, as instead of including lengthy commands to manipulate data, the program can instruct the data to process itself using its own inbuilt commands.  Relationships can be created between objects, which can then inherit properties from other objects.  Another advantage of a modular structure is that messages are passed between modules, which are an essential requirement for the development of software systems that are to be used over computer networks.

Examples of this paradigm are: C++, JAVA, SIMULA, SMALLTALK,ada95, Visual Basic.

Reference:
Computer Science by J.Glenn Brookshear

D.K Every, How Computer Languages Work (1999)
http://www.whatis.techtarget.com/

http://cseg.inaoep.mx/~dortiz/bhcl.html