WishWiki

Module (programming)

A module is a self-contained unit of code that bundles related functionality, data, and logic together for reuse and organization. Modules are foundational to modern software design, enabling developers to break large systems into manageable, testable pieces.

Modules typically encapsulate a specific concern—calculation, file handling, user authentication—and expose a clean interface while hiding internal complexity. This principle, called namespacing and encapsulation, prevents naming conflicts and reduces interdependencies between different parts of a system.

Most programming languages provide native module systems. Python uses files and packages, JavaScript has ES modules and CommonJS, Java organizes code into packages, and languages like Go and Rust treat modules as first-class citizens. Some languages distinguish between modules (logical groupings) and packages (package managers' deployable units), while others use the terms interchangeably.

Well-designed modules improve [[Verification|code verification, enable parallel development, and make systems easier to maintain, debug, and scale. A module might export only the functions or classes meant for external use, keeping helper code private—a practice essential to sustainable codebases.

Related

Namespace (programming), Package Manager, Encapsulation, Code reuse, Abstraction (computing), Software architecture

Wishing…
your wish is being written

✨ Wish for a new page

👁 Wish for another view of this page

Sign in to WishWiki

Keep your wishes together, see your activity — and later, get your own private wiki space.

⏱ Page history