Hi Mike

On Wed, 2011-09-14 at 20:44 +1000, Mike Hamilton wrote:
> So, my very simple suggestion is that month_names_in_dutch(), 
> month_names_in_french() [...] be replaced with month_names_in(language).

The trouble with this is what does the one true method do with this
language name parameter?

For instance, if it used it as a key into a hash of month names per
language - the most obvious choice - how would that hash be extended
with new languages? Only by updating the source code, right? The way
I've done it is to let the user use sub-classing without my code needing
changes.

Alternately, we could hit a per-language file shipped with the module,
but then new languages need new files (and hence a new version), and
there's also the problem of where to store such files.

Just recently I tried this with Locale::Country::SubCountry, and had
CPAN tester failures all over the place. Admittedly, I did try shipping
the one file and installing it automatically - during module
installation - in a dir which was writable by the end user, not in the
module's own dir. But CPAN tester set-ups sometimes don't have home dirs
or they're not writable, or .... So, nope, not that way.

Or, the code could scrape the names directly from the web page I
mentioned in the last email. Messy, /and/ you have to be on-line. Nope,
not that way either :-(.

So, unless you can come up with another way of solving this problem,
I'll leave the design as is.

-- 
Ron Savage
http://savage.net.au/
Ph: 0421 920 622

Reply via email to