Procedural language

A procedural language is a programming language that follows instructions in a sequential manner. Consider the example below:Go to the market
Buy vegetables
Pay water and electricity bills
Go homeIn a procedural language the above instructions will have to be done from the top to the bottom. If one instruction is not carried out the other instructions below it will not be executed.

 Examples of Procedural Programming Languages 

 BASIC
 C
 Java
 FORTRAN
 PASCAL

The above languages listed above are considered procedural because of the manner in which they execute when they are run. Consider one example in C programming:#include <stdio.h>

int main()
{
    int num1 = 5;
    int num2 = 10;

    int sum = num1 + num2;

    printf("%d + %d = %d", num1, num2, sum);

    return (0);
}

/* Output */
// 5 + 10 = 15As we can see the execution goes from top to bottom. In the event that one instruction is wrong the execution is halted and an error occurs in procedural languages if the error isn't handled.

 Advantages 

 It makes learning of programming languages very easy.
 Writing simple programs, testing them and debugging them is very easy when written in procedural manner.
 They are well structured which makes readers easily understand what a program is doing.

 Disadvantages 

 Code reuse is not possible. Which bring us to point number 2
 Raises development costs due to the inability to reuse code
 Testing is difficult especially when the project gets bigger and bigger.

Considering the above pros and cons  is important as you develop projects.

References

Category:Programming languages