Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Module name suggestion

by Anonymous Monk
on Dec 23, 2010 at 12:36 UTC ( [id://878798]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

In my project (say Foo), instead of writing:

use 5.010; use autodie; use strict; use warnings;

and perhaps a few more lines in the future, I want to consolidate this into a single use statement, much like 'use Modern::Perl'. So all my project modules (and scripts) will begin with this preamble.

What would be a good name for this module? Foo? Modern::Foo?

Replies are listed 'Best First'.
Re: Module name suggestion
by Corion (Patriarch) on Dec 23, 2010 at 12:41 UTC

    Maybe Foo::Common or Foo::Preamble?

Re: Module name suggestion
by JavaFan (Canon) on Dec 23, 2010 at 14:18 UTC
    I::am::too::lazy::to::come::up::with::an::editor::macro; I::like::to::have::people::wonder::why::I::did::not::enable::warnings: +:or::strict; I::wonder::what::is::in::this::module; This::enables::features::without::saying::so; Everyone::knows::what::strict::and::warnings::do::noone::knows::my::mo +dule; I::leave::people::guessing::what::is::in::this::common::module; Modern::the::three::year::old::version::of::perl; This::common::Foo::module::does::not::provide::anything::Foo::specific +::Neither::does::it::provide::any::logic;

      Even if you don't have to type it (using macro/template), you still have to look at it. Visual clutter or overload, I say.

      This is for an (internal) project, so chances are greater that every developer knows it.

      It follows DRY principle. If I can group several statements into a sub, why can't I also group several directives/preamble into one line?

      The Foo::common does provide something Foo-related: setting policy for every Foo module.

Re: Module name suggestion
by JavaFan (Canon) on Dec 23, 2010 at 14:21 UTC
    I suggest using a name that tells what it does. Which would mean something like:
    use StrictWarningsAutodieAnd510Features;
      I get the sarcasm, but aside as a shorthand, Foo::common also serves another important function: enforcing uniform policy. It's easier in the future to deprecate something, etc.

        Foo::Policy ?

Re: Module name suggestion
by moritz (Cardinal) on Dec 23, 2010 at 18:32 UTC
Re: Module name suggestion
by Anonymous Monk on Dec 23, 2010 at 14:00 UTC
      But it neither provides anything related to Foo, nor does it have any tools. It's about an as bad misnomer as Blue::Wednesday would be.
        It seems directly related to Foo, because Foo is going to be the sole or primary consumer. And while you may think that using ToolSet with pragmas instead of more meaty modules isn't using it with "tools", you'd be wrong.
Re: Module name suggestion
by Anonymous Monk on Dec 23, 2010 at 19:22 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://878798]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-04-16 05:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found