introduction to Modular Programming
introduction to Modular Programming
Programming Fundamentals
Programming fundamentals
Modular programming is the process of subdividing a computer program into separate sub-
programs. A module is a separate software component.
• Some programs might have thousands or millions of lines and to manage such programs it
becomes quite difficult as there might be too many of syntax errors or logical errors
present in the program, so to manage such type of programs concept
of modular programming approached.
• Each sub-module contains something necessary to execute only one aspect of the desired
functionality.
• Modular programming emphasis on breaking of large programs into small problems to
increase the maintainability, readability of the code and to make the program handy to
make any changes in future or to correct the errors.
1. Ease of Use
2. Reusability
It allows the user to reuse the functionality with a different interface without
typing the whole program again.
BS(Information Technology) 1st Semester. Programming Fundamentals
3. Ease of Maintenance
Concept of Modularization
One of the most important concepts of programming is the ability to group some lines of code into
a unit that can be included in our program. The original wording for this was a sub-program. Other
names include: macro, sub-routine, procedure, module and function. We are going to use the
term function for that is what they are called in most of the predominant programming languages
of today.
Functions are important because they allow us to take large complicated programs and to divide
them into smaller manageable pieces.
Because the function is a smaller piece of the overall program, we can concentrate on what we
want it to do and test it to make sure it works properly.
1. Program Control – Functions used to simply sub-divide and control the program. These
functions are unique to the program being written. Other programs may use similar
functions, maybe even functions with the same name, but the content of the functions are
almost always very different.
Program Control functions normally do not communicate information to each other but use
a common area for variable storage
2. Specific Task – Functions designed to be used with several programs. These functions
perform a specific task and thus are usable in many different programs because the other
programs also need to do the specific task. Specific task functions are sometimes referred
to as building blocks. Because they are already coded and tested, we can use them with
confidence to more efficiently write a large program.