Why use modular code?
There are many reasons to use modular code; however, the following is a list of some very common ones:
- Reusability: Arguably, the most important reason to use modular code is reusability. Much like the parts of a car, a code module can be used in multiple projects and in multiple parts of the project, which cuts down on development time, unexpected behaviors, and bugs.
- Code removability: Much like with a mechanical machine that has been upgraded to use fewer parts, a modular program should allow for the easy removal of all individual modules.
- Code upgrades: When a program is modular, it will be easy to upgrade. If a behavior must be changed, all you need to do is find the code module that handles that behavior and change it without needing to break other, unrelated code. Upgrading modular code is like upgrading a car part, you only need to upgrade that part and the necessary related parts for it to work.
- Code scalability: Modular...