Monolithic and Modular Programming in C program | Coding classpoint

Monolithic Programming 



The program which contains a single function for the large program is called monolithic program. In monolithic program not divided the program, it is huge long pieces of code that jump back and forth doing all the tasks like single thread of execution, the program requires. Problem arise in monolithic program is that, when the program size increases it leads inconvenience and difficult to maintain such as testing, debugging etc. 

Many disadvantages of monolithic programming are:

1. Difficult to check error on large programs size. 

2. Difficult to maintain because of huge size. 

3. Code can be specific to a particular problem. i.e. it cannot be reused. 

Many early languages (FORTRAN, COBOL, BASIC, C) required one huge workspace with labelled areas that may does specific tasks but are not isolated. 

Modular Programming 

The process of subdividing a computer program into separate sub-programs such as functions and subroutines is called Modular programming. Modular programming sometimes also called as structured programming. It enables multiple programmers to divide up the large program and debug pieces of program independently and tested.  

Then the linker will link all these modules to form the complete program. This principle dividing software up into parts, or modules, where a module can be changed, replaced, or removed, with minimal effect on the other software it works with. Segmenting the program into modules clearly defined functions, it can determine the source of program errors more easily. Breaking down program functions into modules, where each of which accomplishes one function and contains all the source code and variables needed to accomplish that function. 

Modular program is the solution to the problem of very large program that are difficult to debug, test and maintain. A program module may be rewritten while its inputs and outputs remain the same. The person making a change may only understand a small portion of the original program.

Object-oriented programming (OOP) is compatible with the modular programming concept to a large extent.

Less code has to be written that makes shorter.

• A single procedure can be developed for reuse, eliminating the need to retype the code many times. 

• Programs can be designed more easily because a small team deals with only a small part of the entire code. 

• Modular programming allows many programmers to collaborate on the same application. 

• The code is stored across multiple files. 

• Code is short, simple and easy to understand and modify, make simple to figure out how the program is operate and reduce likely hood of bugs. 

• Errors can easily be identified, as they are localized to a subroutine or function or isolated to specific module. 

• The same code can be reused in many applications. 

• The scoping of variables and functions can easily be controlled. 

Disadvantages However it may takes longer to develop the program using this technique.


Tags

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.