On Mon, Nov 25, 2013 at 12:27:58PM +0100, Aristotle Pagaltzis wrote:
> 
> there are two issues causing a problem with naming for this module:
> 
> 1. very specific form of input required/expected (hash of weights)

Actually, having seen the output of List::Categorize, it's not hard
to make my module support a hash of arrayrefs (i.e. the output of
List::Categorize), and just count the items in the arrayrefs.
Enforcing consistency of the hash values is probably unnecessary.
(Garbage in, garbage out)

Still, directly or indirectly, a weighted hash indeed.

> 2. tightly bound to a DSL as its API
> 

Yes, the DSL was actually the start of the project.

A colleague basically wanted to be able to process results of Nagios
checks to monitor services instead of hosts. We quickly ended up talking
about having a way to describe the result, using a DSL. The benefit of
that DSL is that it can fit in a single line in a config file, or even
be parsed for correctness in a web form, without giving users the full
power of Perl.

> If you want to be descriptive then you simply cannot give a module like
> this a terribly generic name. To cover (2), you need ::Rules. To cover
> (1), you basically need to name all aspects: takes a hash, specifically
> one where the values are weights, and reduces it to a single value. So
> I ended up with
> 
> Hash::Reduce::Weighted::Rules
> 
> It’s a mouthful but seems necessary to accurately summarize the module.
> None of the names that omit any of these components felt satisfactory:
> whichever one you take out, the shorter name seems to describe a very
> different module.
> 

Many thanks for taking the time to work it out.

I totally agree that Hash::Categorize is much too generic, for example,
and following List::Categorize, should work with a coderef written in
Perl, instead of a DSL.

> I did try to fit “Categorize” in there but it just isn’t specific enough
> to *replace* any component of the name, and if you just *add* it to the
> whole kit and caboodle, the name becomes ludicrous. So I left it out.
> 
> So that’s the best I could do.

Speaking of Categorize, can't we shorting Reduce...Rules to Categorize?

Quoting Wikipedia on "Categorization": "According to the classical view,
categories should be clearly defined, mutually exclusive and collectively
exhaustive. This way, any entity of the given classification universe
belongs unequivocally to one, and only one, of the proposed categories."

"reduces it to a single value" sounds like an accurate description of
"categorizes".

It's probably impossible to remove Hash::Weighted, as it's really what
the input is, one way or another.

Which would leave us with Hash::Weighted::Categorize.

The other option is to give up on being descriptive, and come up with a
"brand" name. In which case, Fleur is just as fine as anything else. :-)

-- 
 Philippe Bruhat (BooK)

 No matter how you dress a cow, it still gives milk.
                                    (Moral from Groo The Wanderer #46 (Epic))

Reply via email to