Module name hierarchy...

Let's say I wanted to submit a module named:

     Class::Error::Foobar

Would this be considered bad form if my "Foobar" module is not related
to the existing Class::Error module in any way?  In other words,
Foobar does not depend on, extend, nor reference the Class::Error
module other than perhaps a courtesy "See Also" mention.

....BC
0
Bill
9/25/2020 6:20:16 PM
perl.module-authors 1604 articles. 0 followers. Follow

7 Replies
141 Views

Similar Articles

[PageSpeed] 13
Get it on Google Play
Get it on Apple App Store

--0000000000007d5c5d05b027eaea
Content-Type: text/plain; charset="UTF-8"

On Fri, Sep 25, 2020 at 2:20 PM BC <Bill.Costa@alumni.unh.edu> wrote:

> Let's say I wanted to submit a module named:
>
>      Class::Error::Foobar
>
> Would this be considered bad form if my "Foobar" module is not related
> to the existing Class::Error module in any way?  In other words,
> Foobar does not depend on, extend, nor reference the Class::Error
> module other than perhaps a courtesy "See Also" mention.
>

It is not necessarily bad form, but if there is an existing "Class::Error"
ecosystem you might consider asking the author first in case they wanted to
use that sub-namespace. That does not really seem to be the case here.

-Dan

--0000000000007d5c5d05b027eaea
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">On Fri, Sep 25, 2020 at 2:20 PM BC &lt;<a=
 href=3D"mailto:Bill.Costa@alumni.unh.edu">Bill.Costa@alumni.unh.edu</a>&gt=
; wrote:<br></div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quo=
te" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204=
);padding-left:1ex">Let&#39;s say I wanted to submit a module named:<br>
<br>
=C2=A0 =C2=A0 =C2=A0Class::Error::Foobar<br>
<br>
Would this be considered bad form if my &quot;Foobar&quot; module is not re=
lated<br>
to the existing Class::Error module in any way?=C2=A0 In other words,<br>
Foobar does not depend on, extend, nor reference the Class::Error<br>
module other than perhaps a courtesy &quot;See Also&quot; mention.<br></blo=
ckquote><div><br></div><div>It is not necessarily bad form, but if there is=
 an existing &quot;Class::Error&quot; ecosystem you might consider asking t=
he author first in case they wanted to use that sub-namespace. That does no=
t really seem to be the case here.</div><div><br></div><div>-Dan</div></div=
></div>

--0000000000007d5c5d05b027eaea--
0
grinnz
9/25/2020 6:59:17 PM
On 25/09/2020 19:59, Dan Book wrote:
> On Fri, Sep 25, 2020 at 2:20 PM BC <Bill.Costa@alumni.unh.edu 
> <mailto:Bill.Costa@alumni.unh.edu>> wrote:
> 
>     Let's say I wanted to submit a module named:
> 
>           Class::Error::Foobar
> 
>     Would this be considered bad form if my "Foobar" module is not related
>     to the existing Class::Error module in any way?  In other words,
>     Foobar does not depend on, extend, nor reference the Class::Error
>     module other than perhaps a courtesy "See Also" mention.
> 
> It is not necessarily bad form, but if there is an existing 
> "Class::Error" ecosystem you might consider asking the author first in 
> case they wanted to use that sub-namespace. That does not really seem to 
> be the case here.

I'd say that you should ask no matter what, and should also consider 
using something like Foobar::Error instead. Partly to avoid trampling on 
someone else's namespace, but also because using C::E::Foobar might give 
your users some incorrect expectations if they are already using 
Class::Error elsewhere.

-- 
David Cantrell
0
david
9/25/2020 9:12:47 PM
On Fri, September 25, 2020 4:12 pm, David Cantrell wrote:
> On 25/09/2020 19:59, Dan Book wrote:
>> On Fri, Sep 25, 2020 at 2:20 PM BC <Bill.Costa@alumni.unh.edu
>> <mailto:Bill.Costa@alumni.unh.edu>> wrote:
>>
>>     Let's say I wanted to submit a module named:
>>
>>           Class::Error::Foobar
>>
>>     Would this be considered bad form if my "Foobar" module is not
>> related
>>     to the existing Class::Error module in any way?  In other words,
>>     Foobar does not depend on, extend, nor reference the Class::Error
>>     module other than perhaps a courtesy "See Also" mention.
>>
>> It is not necessarily bad form, but if there is an existing
>> "Class::Error" ecosystem you might consider asking the author first in
>> case they wanted to use that sub-namespace. That does not really seem to
>> be the case here.
>
> I'd say that you should ask no matter what, and should also consider
> using something like Foobar::Error instead. Partly to avoid trampling on
> someone else's namespace, but also because using C::E::Foobar might give
> your users some incorrect expectations if they are already using
> Class::Error elsewhere.
>
> --
> David Cantrell
>
>

I'm of two minds. If the top and second level is large enough then it's
possible that the "ecosystem" has escaped the menagerie and it not really
under the top-and-second namespace author's control. Likewise, if the
author is clearly limiting their module to one purpose, then I don't
believe this is an issue.

But that's making assumptions that I don't know are true about your case.
If neither one is true, then yes, contact the author.

Disclosure of bias on my part: I am the author of Math::Polynomial::Solve,
and the then-author of Math::Polynomial was clearly an example of the
second case.

     --john
0
jgamble
9/25/2020 11:08:25 PM
Thanks to John, David, and Dan for their thoughts on my module naming
question.  So to avoid potentially tromping on another author's name
space doing something like:

    Class::Error::Foobar

where `Class::Error` already exists, I can avoid the whole problem by
just picking a different but similar name:

    Class::Fault

which is currently not used.  For my purposes that name works well.
The only thing I don't like is that it feels like I am squatting on
something fairly generic near the top of the name space.  If I were to
push my one and only module down a level as:

    Class::Fault::Foobar

would it be a faux pas if there is no Class/Fault.pm or anything else
at that second level?

....BC
0
Bill
9/30/2020 5:55:40 AM
--0000000000005e0e2305b081962a
Content-Type: text/plain; charset="UTF-8"

On Wed, Sep 30, 2020 at 1:56 AM BC <Bill.Costa@alumni.unh.edu> wrote:

> The only thing I don't like is that it feels like I am squatting on
> something fairly generic near the top of the name space.  If I were to
> push my one and only module down a level as:
>
>     Class::Fault::Foobar
>
> would it be a faux pas if there is no Class/Fault.pm or anything else
> at that second level?
>

There is no requirement or reason that each step of the module hierarchy
needs to exist as a separate module. (Just imagine if that was needed for
https://metacpan.org/pod/Acme::Working::Out::Dependencies::From::META::files::Will::Be::Wrong::At::Some::Point::Like::This::Module::For::Instance
)

-Dan

--0000000000005e0e2305b081962a
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">On Wed, Sep 30, 2020 at 1:56 AM BC &lt;<a=
 href=3D"mailto:Bill.Costa@alumni.unh.edu">Bill.Costa@alumni.unh.edu</a>&gt=
; wrote:</div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" =
style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pa=
dding-left:1ex">
The only thing I don&#39;t like is that it feels like I am squatting on<br>
something fairly generic near the top of the name space.=C2=A0 If I were to=
<br>
push my one and only module down a level as:<br>
<br>
=C2=A0 =C2=A0 Class::Fault::Foobar<br>
<br>
would it be a faux pas if there is no Class/Fault.pm or anything else<br>
at that second level?<br></blockquote><div><br></div><div>There is no requi=
rement or reason that each step of the module hierarchy needs to exist as a=
 separate module. (Just imagine if that was needed for=C2=A0<a href=3D"http=
s://metacpan.org/pod/Acme::Working::Out::Dependencies::From::META::files::W=
ill::Be::Wrong::At::Some::Point::Like::This::Module::For::Instance">https:/=
/metacpan.org/pod/Acme::Working::Out::Dependencies::From::META::files::Will=
::Be::Wrong::At::Some::Point::Like::This::Module::For::Instance</a>)</div><=
div><br></div><div>-Dan=C2=A0</div></div></div>

--0000000000005e0e2305b081962a--
0
grinnz
9/30/2020 5:58:12 AM
On Wednesday, 30 September 2020 07:55:40 CEST BC wrote:
> I can avoid the whole problem by
> just picking a different but similar name:
> 
>     Class::Fault
> 
> which is currently not used.  For my purposes that name works well.
> The only thing I don't like is that it feels like I am squatting on
> something fairly generic near the top of the name space.  

Which would fine fine provided your Class::Fault is relatively generic. I.e. can 
it be used by an unrelated module ?

> If I were to
> push my one and only module down a level as:
> 
>     Class::Fault::Foobar
> 
> would it be a faux pas if there is no Class/Fault.pm or anything else
> at that second level?

If your Fault module is coupled to Foobar, why not create a Foobar::Error (or 
Foobar::Fault) module ?

For the record, I've chosen the latter approach with Config::Model::Exception.

HTH
0
domi
9/30/2020 9:12:47 AM
Thanks to Dan for that superlative example and Domi who asked:

> ... provided your Class::Fault is relatively generic. I.e. can it be
> used by an unrelated module ?

The module will indeed be generic.  It will be yet another way to
solve the common problem of error handling and reporting.  So since
there is no requirement for each step in the path to be an existing
module, I will go with

    Class::Fault::Foobar

where 'Foobar' will be some sort of descriptive name that attempts to
succinctly identify the strategy or approach being used for handling
faults.

Many thanks to all who took time to reply.

....BC
0
Bill
9/30/2020 3:50:16 PM
Reply: