teach-ict.com logo

THE education site for computer science and ICT

3. Procedural Languages

One of the most common programming paradigms is the idea of 'procedural' languages. Procedural languages group sets of instructions together into subroutines or functions. Sequence, selection, and iteration are key components of writing code in procedural languages.

This is a very powerful and versatile approach to programming. We have a detailed section on procedural programming here. But to sum up the key points:

  • Procedural languages are imperative. This means that the programs are given a list of explicit instructions, called an algorithm, telling them exactly how to carry out a task.
  • Procedural languages are sequential. This means that the order of instructions is important

Examples of Procedural languages are

C, Pascal, FORTRAN, COBOL

A typical clip of source code written in a procedural language:-

y = 1224;
for (x = 0; x < 100; x++) {
   z = y + x;
}

In this clip, a variable y is being set, then the code enters a loop. So the procedural language is precisely defining what the computer should be doing step by step.

Pros

  • Excellent for general purpose programming
  • Many books and references available on well-tried and tested coding algorithms - no need to re-invent the wheel.
  • Good level of control without having to know precise target CPU details - unlike low level languages
  • Portable source code - use a different compiler to target a different CPU

Cons

  • As there are so many procedural languages, a programmer tends to have to specialise in a particular language in order to get work.
  • For example : A COBOL specialist has a different clientele to a 'C' specialist.
  • Need to be very precise and knowledgeable about programming instructions, and so a fully de-bugged working program takes more time to put together compared to fourth generation languages such as Simulink.
  • Not as efficient as hand-crafted source code written in a low level language
  • Poor at handling fuzzy conditions as found in Artificial Intelligence applications - unlike declarative languages such as PROLOG.

Challenge see if you can find out one extra fact on this topic that we haven't already told you

Click on this link: What is a procedural language