Chapter 7. Modularity

Imagine a program consisting of, say, 100 different functions. By most standards, that’s a small program. If we end up changing the list of arguments passed to one of those functions, which other functions do we have to modify? If we change some of the code, how do we find out whether any of the other functions have become obsolete? If we need one of the functions for another program, how many of the other functions also have to be added to that other program, because they are used by the function we need?

If there is no organization at all to your program, finding the answer to any of these questions means going through all of the functions. There are of course tools that can help us here, such as the Unix utility grep ...

Get Eloquent JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.