Try the fastest way to create flashcards
Question

What are the advantages of breaking a large program into modules?

Solution

Verified
Step 1
1 of 2
  1. 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.

  2. 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.

  3. 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.

  4. 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

Starting Out with Python 3rd Edition by Tony Gaddis

Starting Out with Python

3rd EditionISBN: 9780133582734Tony Gaddis
618 solutions
Fundamentals of Database Systems 7th Edition by Ramez Elmasri, Shamkant B. Navathe

Fundamentals of Database Systems

7th EditionISBN: 9780133970777Ramez Elmasri, Shamkant B. Navathe
948 solutions
Introduction to Algorithms 3rd Edition by Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen

Introduction to Algorithms

3rd EditionISBN: 9780262033848Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen
872 solutions
Introduction to Algorithms 4th Edition by Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen

Introduction to Algorithms

4th EditionISBN: 9780262046305Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen
945 solutions

More related questions

1/4

1/7