Coupon Accepted Successfully!


Modular Programming

Generally, industry-programming projects consist of thousands of lines of instructions or operation code. This kind of a huge monolithic program would be unmanageable and incomprehensible. Therefore, it is difficult to design, write, debug and test the project. Then the complete project is divided into sub-problems or small modules. Each independent module is separately named and has individually invokeable program elements. The size of the modules are reduced to a humanly comprehensible and manageable level. This approach is known as modular programming. Usually the divide-and-conquer approach is used in programming.

The characteristics of the module are given below:
  1. Each module is independent of other modules.
  2. Each module has one input and one output.
  3. A module is small in size.
  4. Programming a single function per module is a goal.
Advantages of Modular Programming The advantages of modular programming are the following:
  1. It is easy to write, test and debug a module.
  2. Generally, the modules of common nature are prepared which can be used at many places.
  3. The programmer can divide tasks and use the previously written programs.
  4. If a change is to be made, it is made in the particular module; the entire program is not affected.
  5. Pieces can be independently debugged.
  6. Work for multiple programmers can be divided.
  7. Code can be reused.
  8. Manageable Reduces problem to smaller, simpler, humanly comprehensible problems.
  9. Divisible Modules can be assigned to different teams/programmers. Enables parallel work, reducing program development time. Facilitates programming, debugging, testing, maintenance.
  10. Portable Individual modules can be modified to run on other platforms.
  11. Re-usable Modules can be re-used within a program and across programs.
Disadvantages of Modular Programming The disadvantages of modular programming are the following:
  1. The combining of modules together is a difficult task.
  2. It needs careful documentation as it may affect the other parts of the program.
  3. While testing modules, it is found that the module under test may require data from other modules or its results may be used by other modules. To solve such problems, special programs called drivers are to be developed to produce the desired data for the testing of modules. The development of drivers requires extra effort and time.
  4. Modular programming requires extra time and memory.
  5. The modular programming was originally developed for writing long programs but this technique can also be used for shorter programs written for microcomputers. Modules ate divided on functional lines and hence, they can form a library of programs. Modules of 20 to 50 lines should be developed. They are very useful. There is unnecessary wastage of time in preparing shorter modules. Longer modules do not become of general nature. The modules should be developed for common tasks and should be of general form.

Test Your Skills Now!
Take a Quiz now
Reviewer Name