Back to Lingo

Module

A module is a self-contained unit of code that groups related functions, classes, or variables. Modules help organize codebases into manageable pieces, improve readability, and allow reuse across different parts of an application. Languages provide module systems such as ES modules in JavaScript or packages in Python.

Why it matters

Modular code is easier to maintain, test, and refactor. Modules also enable clear boundaries between components, improving collaboration and reducing unintended side effects when updating functionality.

Examples

A utils.js file exporting helper functions, or a Python package that organizes related classes. Lessons like Organizing Functions in Files demonstrate modular structure.

See More

Further Reading

You need to be signed in to leave a comment and join the discussion