When should a programmer consider modularizing a program with functions?
1
Expert's answer
2017-05-03T08:58:08-0400
Modular programming is a software design technique that emphasizes separating the functionality of a program into independent, interchangeable modules, such that each contains everything necessary to execute only one aspect of the desired functionality.
The functions, or modules, are sets of statements that perform an operation or compute a value.
1. Real world programs often are large and complex 2. To maintain simplicity and readability in large and complex programs, we use a short main, and other functions instead of using one long main 3. We should to separate a solution into a group of modules, each module is easier to understand 4. And we can to use existing modules as building blocks to create new programs. 5. A module is smaller than a complete program, so testing is easier. 6. Use of modules (modularity) usually reduces the overall length of programs
Comments
Leave a comment