Anda di halaman 1dari 4

Classification of Programming Languages

Introduction
A computer language is a software environment, which makes it possible to write instructions that the computer can
understand and execute. Thousands of computer languages have been developed over the years. Some of these
languages are still being used while others have fallen into obscurity. Although many computer languages have
been designed and implemented, most programmers have a limited knowledge of these languages. This growing
trend is creating a deficiency among our programmers because there are a lot of benefits that may be derived from
studying and appreciating these languages. The aim of this course is to present a general overview of the various
languages that have been implemented. In order to achieve this, we will attempt to classify the languages, which
have been implemented, into various groups and identify the major characteristics of each group. In addition we
will be looking at some of the design/implementation issues that should be considered when a new language is being
created.

Classification of Programming Languages


There are several different criteria, which may be used to group the different programming languages. We will now
examine some of these classifications.

A language may be classified as being either a low-level language or a high-level language.


• Low-level languages. These languages use commands, which are very close to the native language of the
computer. The native language of any computer is a set of unique string combinations of ones and zeroes. In
addition, each string combination has to have a unique meaning.
• High-level languages. These languages use commands, which are very close to the ones used in human
speech. This means that there is a wider gap between the commands and the native language of the computer.
In addition, each command should also have a unique meaning associated with it.

Advantages of Low-Level Languages.


1. These languages normally have a faster execution speed than those written in high level languages. This occurs
because the programs are very close to the native language of the computer and therefore needs little or no
interpretation.

Disadvantages of Low-Level Languages.


1. These languages are machine oriented. This means that a program which is written for a specific type of
machine, will not work on any other machine unless it uses the same processor. In other words, the programs
written by these languages are not portable.
2. These languages are often very difficult to use. This happens because humans tend to have great difficulty in
thinking in terms of ones and zeroes. This makes the process of program development extremely difficult.
3. These languages create programs that are extremely difficult to debug.

Advantages of High-Level Languages.


1. These languages are easier to use than low-level languages. This happens because the commands in these
languages are much closer to the languages spoken by humans.
2. These languages are designed to solve problems within specific domains. This means that each language will
have a set of programming constructs, which makes it easier to solve these problems.
3. These languages create programs that are more portable. This is because these languages are not machine
oriented.
4. These languages create programs which are relatively easy to debug.

Disadvantages of High-Level Languages.


1. These languages usually create programs that have an execution speed, which is slower than the programs
created using a low-level language.
Language Generation.
A programming language may also be grouped according to its language generation. There are five language
generations that have evolved over the years and each generation tries to improve on the previous generation. These
generations are defined as follows:

1st Generation. (late 1940s) - Machine Language.


2nd Generation (early 1950s) - Assembly language.
3rd Generation (late 1950s – 1970s) - High Level Languages. (earliest - Fortran, COBOL)
4th Generation (late 1970s onwards) - Database oriented
5th Generation - Natural Language Processing.

Machine Language. This is the native language of the computer.

Assembly Language. This is a language in which a mnemonic code is associated with each machine language
command. The programmer will use the mnemonics to write useful programs.

High Level Language. This is a language that uses commands, which are very close to the ones used in human
speech.

Fourth Generation Languages. These are database oriented high level languages that contain a lot of pre-written
routines/modules for manipulating a database. In addition the programmer is not allowed to know the
implementation details behind each routine. These languages allow the programmer to tell the computer what he
wants done, rather than how to carry out the task.

Natural Language Processing. These are languages in which computer instructions are written using natural
languages. The problem with these languages is that a natural language is context sensitive (the meaning of the
words is often dependent upon the context in which it is used.) These types of languages are not yet well developed.

Language Paradigms.
All programming languages may fall into one of four different categories. These categories are called language
paradigms (style of programming). The four paradigms are: Imperative/Procedural, Declarative/Rule Based,
Applicative/Functional, Object Oriented.

Imperative/Procedural.

Examples: Pascal, COBOL, PL/I, RPG etc.

A language is said to be imperative or procedural if it has the following attributes.


1. It contains a set of commands that allows the computer to change its state. A computer is said to change its
state if the execution of a command allows new values to be stored in one or more memory locations. The
commands that create these state changes are called assignment operators.
2. In order to solve a problem the programmer has to tell the computer what to do and how to do it. (3GL)
3. The written commands are executed sequentially by default, although the order may be changed by the use of
various control structures. [e.g. Loops, selection statements etc.]
4. The syntax of these languages normally consists of statements, which are listed, in the order in which they must
be executed. Each statement is usually placed on a new line.
Declarative/Rule Based/Artificial Intelligence.

Example: LISP

A language is said to be declarative if it has the following attributes.


1. In order to solve a problem the programmer has to define the set of facts that must be manipulated in order to
get the correct result.
2. The programmer must also define the set of inference rules that are to be used to draw logical conclusions from
the set of facts.
3. The order in which the rules and facts are stated is not important.
4. The syntax usually consists of a set of facts followed by a set of rules. Also, in order to obtain any information,
we must construct a query.

Applicative/Functional.

Example: C

A language is said to be applicative if it has the following attributes.


1. Most commands are written in the form of functions.
2. Each function should return only one answer, which is dependent on the input it receives.
3. The state of the computer rarely changes when a function is called (executed).
4. The assignment operator is either non-existent or is rarely used.
5. The syntax normally consists of functions that take other functions as their input.

Object Oriented.

Examples: Powerbuilder, Visual Basic, Visual Foxpro

An object-oriented language has the following attributes.


1. A programmer is able to solve a problem by creating a set of cooperating objects.
2. Each object has its own data structures and data operations.
3. The data structures inside the object may only be manipulated by using the operations that it contains.
4. It supports the concept of inheritance. Inheritance is the ability to create new objects by simply allowing the
new object to assume the identity [data structures and data operations.] of the old object.

Extreme care has to be taken when attempting to place a language within a particular language paradigm. This is
because there is no clear distinction among the different paradigms. In attempting to classify a language we have to
identify the most distinguishing characteristic of the language in addition to examining the total number of features
that it possesses.

End of Class Questions.

1. Doctor Little wants a program, which will allow him to be able to deduce the possible illnesses of his patients,
based on the symptoms that they are experiencing. Which language paradigm would you pick a language from,
in order to solve Doctor Little’s problem?
2. Give reasons as to why you would use a language from the above paradigm, to solve Dr. Little’s problem.
3. Distinguish between declarative and imperative languages.
4. A school wants to design a database system, which is capable of storing information about students, teachers
and subjects. Suggest the most appropriate type of language to use when designing this system.
5. Kerry has decided to use a low-level language to create a computer game. She came to this decision because she
wants to achieve a high execution speed. Identify and explain 2 disadvantages that her choice may create.
Orthogonality. This refers to the attribute of being able to combine the various features of the language in different
ways, with each combination being useful. A programming language that exhibits orthogonality is much easier to
learn and use. This occurs because the language has very few special or exceptional cases that the user must
understand. (E.g. Suppose a language allows an expression to produce a value, and it also allows a conditional
statement, then these two features are orthogonal if any expression can be used within the conditional statement =>
if squareroot(x) = 56 then …).

Anda mungkin juga menyukai