Modular programming

Modular programming also called as stepwise refinement or top-down design is a programming approach that breaks down program functions into modules.

Modular programming definition
Modular programming is a technique of developing software by separating the functionality of a program into independent, interchangeable modules that are combined together to get the final working software.

Programming Languages that support the concept of modular programming are Ada, Algol, COBOL, Component Pascal, D, Erlang, F, Fortran, Haskell, HyperTalk, IBM/360 Assembler, IBM RPG, Java (packages are considered as modules), MATLAB, ML, Pascal, Perl, PL/I, Python, Ruby, SmallTalk etc.

Modular programming is a solution to the problem of very large programs that are difficult to debug and maintain. Libraries of components built from separately compiled modules can be combined into a whole by using a programming tool called linker.

Advantages of Modular Programming

Some advantages of modular programming are as follows:

  1. Faster development.
  2. Several programmers can work on individual programs at the same time.
  3. Easy debugging and maintenance.
  4. Easy to understand as each module works independently to another module.
  5. Less code has to be written.
  6. The scoping of variables can easily be controlled.
  7. Modules can be re-used, eliminating the need to retype the code many times.

Modular programming concept is compatible with object-oriented programming (OOP) to a large extent.