Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a module

I have trouble understanding the concept of modules. Are they translation units? Are they like .ccp files and .h files?.

In my textbook it is described as, "A modular design consists of a set of modules, which are developed and tested separately. Modular programming implements modular designs and is supported by both procedural and object-oriented languages. The C programming language supports modular design through library modules composed of functions. The stdio module provides input and output support, while hiding its implementation details; typically, the implementation for scanf() and printf() ships in binary form with the compiler. The stdio.h header file provides the interface, which is all that we need to complete our source code. This chapter describes how to create a module in an object-oriented languages using C++, how to compile the source code for each module separately and how to link the compiled code into a single executable binary. The chapter concludes with an example of a unit test on a module.

MODULES

A well-designed module is a highly cohesive unit that couples loosely to other modules. The module addresses one aspect of the programming solution and hides as much detail as practically possible. A compiler translates the module's source code independently of the source code for other modules into its own unit of binary code."

like image 952
sangmin park Avatar asked Feb 17 '18 17:02

sangmin park


1 Answers

In this context (i.e. the general English sense), a module is something that bolts on to other things to form a single whole; that's as far as the definition goes without further specification.

If you're reading this as there being some concept called "module" baked into C++, there isn't (yet). The author is just describing how "things come together" when you bolt on different libraries and such into one finished program.

The wording you've quoted doesn't really say much of any valuable substance.

like image 116
Lightness Races in Orbit Avatar answered Sep 30 '22 17:09

Lightness Races in Orbit