Submodules discouraged?

I think I’ve heard on Discourse and Slack that using submodules as internal helper modules for code organization is discouraged, tends to cause more problems than it solves, etc. This seems quite surprising to me.

Is it actually the case that submodules are discouraged? If so, why? If not, is there a related notion floating around (some other use of modules which is supported but the community has moved away from) that I might be confusing?

1 Like

Submodules are fine, there’s certainly no recommendation against them.


My personal preference is to create submodules as a way of making code independent from everything else so if the package gets big enough its simple to create separate packages.


I would say that submodules are fine, and make most sense when

  1. the codebase is complex (think at least 2k LOC in most cases, but some much larger projects have no submodules),

  2. the modules can be organized into smaller parts in a meaningful way that provides some benefits (cleaner API),

  3. but it’s not sensible to split code into separate packages.