What are the advantages of breaking a large program into modules?
Solution
Verified-
If you've defined a bunch of functions, then by putting those in separate module files you won't have to scroll past them to see the mainline logic of your program.
-
Splitting a program into modules where each module is a collection of related functions makes it easier to reuse code between programs. You may find that you have several programs that all need to perform the same astronomy calculations (you're an astronomer in this example), so the module you've created with a bunch of astronomy functions will be useful to import into each of them.
-
Once you've used a module for a while, you can be pretty sure you'll have worked out all the bugs in it. So it reduces the possibility of bugs.
-
When working in a group, it's both easier and more useful for each coder to work on a single module of related functions than on some random selection of functions/ sections of code.
Create a free account to view solutions
Create a free account to view solutions
Recommended textbook solutions


Fundamentals of Database Systems
7th Edition•ISBN: 9780133970777Ramez Elmasri, Shamkant B. Navathe
Introduction to Algorithms
3rd Edition•ISBN: 9780262033848Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen
Introduction to Algorithms
4th Edition•ISBN: 9780262046305Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. CormenMore related questions
- computer science
1/4
- computer science
1/7