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:
- Faster development.
- Several programmers can work on individual programs at the same time.
- Easy debugging and maintenance.
- Easy to understand as each module works independently to another module.
- Less code has to be written.
- The scoping of variables can easily be controlled.
- 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.