Re: documentation best practices for internal modulesby Athanasius (Bishop)
|on Jan 09, 2018 at 07:27 UTC||Need Help??|
Hello hotshoe, and welcome to the Monastery!
You have received some good answers above. I just want to add a couple of points:
(1) Your statement:
The client shouldn't be interfacing directly with these submodules.
is ambiguous. Do you mean that the client must not access these modules directly; or only that the client doesn’t need to do so to use the Foo module? As a general rule, you should aim for the latter. Good design entails loose coupling between modules. Even if a given module is not likely to be reused, design it as though it could be reused and your architecture will be cleaner and easier to maintain.
Perl doesn’t have an infatuation with enforced privacy. It would prefer that you stayed out of its living room because you weren’t invited, not because it has a shotgun.
Perl has a simple convention to indicate “not invited” — an initial underscore. So, if you rename Foo::Util to Foo::_Util, any experienced Perl programmer will immediately know that this module is for internal use only. An example is provided by the Moo::_Utils module in the Moo distribution on CPAN.
Hope that helps,