What is Procedural programming?
Procedural
programming is a term used to denote the way in which a computer programmer
writes a program. This method of developing software, which also is called an
application, revolves around keeping code as concise as possible. It also
focuses on a very specific end result to be achieved. Imperative programming is
another term used to signify this type of development. When it is mandatory
that a program complete certain steps to achieve specific results, the code is
said to have been written according to procedural programming.
Software
developers who program according to this concept usually write a preliminary
plan in plain language prior to actually writing code. Procedural programming
often is taught to beginner students of computer science because of the logic
behind it. They are encouraged to think in terms of a series of necessary steps
that must be taken to accomplish a goal.
For
example, the professor might encourage the class to write down a set of
required actions to take to make a peanut butter and jelly sandwich. Pretending
not to know how to make the sandwich each student’s attempts to follow, step by
step, the instructions. They learn that if anything is left out, they will not
end up with the final product that they wanted, so they learn the importance of
precise instructions. This realization serves to help the student when he or
she begins to write actual code.
Procedural
programming is not always the preferred method of coding applications. Software
that is highly complex can require literally thousands of lines of code, making
it somewhat more difficult for a team of people to work with it. Some
programmers hold the opinion that extremely large applications can become
difficult to maintain by one developer.
Some
people wrongly believe that it is impossible to write very large or complex
software in a procedural programming language. Certain programs might be more
easily written using Object Oriented Programming (OOP), but this does not mean
that they cannot be developed procedurally. The Linux kernel, which is the core
of an open-source operating system, is written using procedural programming.
Other major applications such as the Apache server, the Drupal content
management system and Samba, are all written in this manner. These applications
are large and are considered to be complex by the overwhelming majority of
programmers.
Among
the procedural programming languages in existence are C, FORTRAN and Python.
Many important applications and utilities have been coded in such languages.
For example, Anaconda, the installer for Fedora Linux, is written in Python, as
are various software management tools.
Advantages of Procedural Programming:
ü Its relative simplicity and ease of implementation
of compilers and interpreters
ü The ability to re-use the same code at different
places in the program without copying it.
ü An easier way to keep track of program flow.
ü The ability to be strongly modular or structured.
ü Needs only less memory.
Disadvantages of Procedural languages:
ü Procedural languages are difficult to relate with
the real world objects.
ü Procedural codes are very difficult to maintain, if
the code grows larger.
ü A procedural language does not have automatic memory
management as like in Java. Hence, it makes the programmer to concern more about
the memory management of the program.
ü The data, which is used in procedural languages, are
exposed to the whole program. So, there is no security for the data.
Examples of Procedural languages:
Ø BASIC, C, Pascal, FORTRAN
Comments
Post a Comment