laziness, impatience, and hubris | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
This might sound like it's coming from nowhere, but your module belongs nowhere more than in the Lingua::EN namespace. Perhaps Lingua::EN::Time::Duration would work.
Let me explain. Your module is, after all, Anglocentric. A module in DateTime or other general-purpose namspaces in my opinion should not be so centered on a single natural language. I certainly wouldn't want to use an application library that only accounted for Brazilian Portuguese users or Chinese users that came from a general-purpose repository. I think the criteria for putting such a thing in the DateTime namespace should include some more than just working with dates and times. It should be more data-centric, with language definitions that allow one to specify a language and get the duration in that language. If it defaults to English and the only initial language definition is English, those two things wouldn't bother me a bit. However, I think it's pretty arrogant of Anglophones to assume that a general-purpose tool should be built around English as an intimate part of the problem description (and I'm a corn-fed Midwestern guy, so this isn't just some anti-American backlash). Alternatively, instead of having a data-centric solution under DateTime, multiple different Lingua::foo::Time::Duration modules could pop up once the theme is set. That would be bad for code reuse, but it would allow each to combine the strings with the code with no problem and also allow any special idea of time we don't understand (half or quarter hours being special, a four-hour watch, etc) to be coded separately. In all, it's probably best to make it based around a language definition and share the code, though. Special cases could be taken care of by subclassing. I guess what my point boils down to is that your killer feature that should be offered to an existing module maintainer or used as the justification of a new CPAN module should be natural language independence. I think a DateTime::Duration or DateTime::NaturalLanguage or whatever that is easy to make work with more than one natural language would be a heck of a tool. Time::Duration has already been localized into at least Swedish and Japanese, and it'd be really nice if that could be done without changing strings in the code. In reply to Re: RFC: My duration-formatting module
by mr_mischief
|
|