23
Modules
Modules help developers better organize their source code. You can organize code hierarchically or based on context. The alternative to using modules is a monolithic approach where the entire application resides in a single source file. This approach becomes cumbersome when an application includes hundreds, even thousands, of lines of source code. Monolithic applications of that size are hard to navigate and maintain. You can reorganize your application into modules to prevent these sorts of problems.
Fundamentally, modules allow you to group related items. These include structs, enums, functions, and globals. However, modules can also be empty. The name of the module hopefully indicates its context. For example, a module named calculus ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access