Module

An encapsulation of code, which contains classes, functions, constants, or other language constructs. Some languages have a concept of a module, but not all do.

If a programming language does not have modules, typically it will at least support namespaces. While not identical, both modules and namespaces relate to grouping similar functionality together for organizational or logical purposes.

One big benefit to modular code is that the code much easier to use as a library. Instead of importing the entire codebase, a programmer may decide to import only the parts they need.