In my last CS101 post we began to discuss different programming language paradigms, and how they affect the performance, correctness and universality of programs. In this installment we’ll provide more detail on one of the most important distinctions between programming languages, namely how they provide modularity.
Programs can be huge: Even a modest webapp may consist of hundreds of thousands of lines of code. One of the main concerns a programmer has is how to structure a program so that it’s readable and maintainable by herself and others. Having one gigantic lump of code is as untenable as trying to build a house from a single giant pile of bricks, lumber and hardware.
Instead, much of the art of programming consists of breaking the program down into components, or modules, and then further breaking down those modules into submodules, and so on down. Modules provide organization and structure through separation of concerns, i.e., a single module is responsible for a single area of functionality.