Subject: Developers of Sympa
List archive
Re: [sympa-developpers] CPAN alternatives for time-related functions
- From: David Verdin <address@concealed>
- To: IKEDA Soji <address@concealed>, address@concealed
- Subject: Re: [sympa-developpers] CPAN alternatives for time-related functions
- Date: Tue, 25 Mar 2014 11:00:43 +0100
Le 25/03/14 04:40, IKEDA Soji a écrit :
Hi, On Mon, 24 Mar 2014 15:30:57 +0100 Guillaume Rousse <address@concealed> wrote: The Sympa::Tools::Time module contains a few time-related functions, mostly related to conversion between string and timestamps formats: epoch2yyyymmjj_hhmms() adate() get_midnight_time() epoch_conv() date_conv() duration_conv() I overlookded these functions. epoch2yyyymmjj_hhmms() is used only once; adate() is never used; get_midnight_time() is used only once. Former two may be replaced with strftime() (although locale should be considered). parse_date() Date::Parse::str2time() may be an alternative to time_utils::parse_date() if it is targetted to Date: header fields. And anyway nothing is better than the module recently maintained. I don't stick to this module.Me neither. Actually, whichever modules is good to me. Despite the minimal requirement "it must do what we need", my only concern is the actual module maintenance. If it installs correctly, I don't care. A wide range of functions is always good because we don't know what we'll need in he future and we could have some pretty exotic concerns, such as mail headers analysis or date internationalisation. In addition, I'll say that, when we chose a module, this should be a definitive choice, in order to simplify package maintainers life... According to these concerns : 1) Date::Parse (in module TimeDate): - last version: 18 February 2013 - development difficult to apprehend. Last displayed version was in 2009 but it was 1.20 and it is now 2.30, so I think the maintainer just deleted previous versions 2) Date::Manip: - last version: 3 March 2014 - development: same as Date::Parse. A big gap between apparent previous and current version - Good point : internationalisation is ready: there seem to be packages dedicated to translations. 3) DateTime: - last version: 11 March 2014 - actively developped since 2011 Consequently, I would have some preference for DateTime, as it is impressively detailed AND well maintained. We may miss the internationalization process, but as we do it in Sympa already, we don't really care. I note that i the Dependencies, there is module called Class::Singleton (written by Andy Wardley, which is a good point for me) that we may use for the questions of singleton we spoke about in recent threads. Those 300 lines of code would easily be replaced by some perl module available from CPAN. Here is a list of potential alternatives: 1) Date::Parse: no dependencies, pure perl, but limited to date string conversions (it would not replace duration_conv(), for instance). 2) Date::Manip: few dependencies, pure perl, no idea about the exact coverage 3) DateTime framework (DateTime, DateTime::Format::Mail, etc...): multiple dependencies, native code, but covers practically everything. They could be potentially others, but I limited myself to the one known to be actively maintained nowadays. That's basically a choice between a lightweight-but-limited vs heavywheight-but-complete external dependency. I'd personaly go for DateTime framework, which is basically in line with the "let's get rid of old environement constraints", but that's a merely a project management decision. Regards, --- Soji --
A bug in Sympa? Quick! To the bug tracker!
|
Attachment:
smime.p7s
Description: Signature cryptographique S/MIME
-
[sympa-developpers] CPAN alternatives for time-related functions,
Guillaume Rousse, 03/24/2014
-
Re: [sympa-developpers] CPAN alternatives for time-related functions,
IKEDA Soji, 03/25/2014
-
Re: [sympa-developpers] CPAN alternatives for time-related functions,
David Verdin, 03/25/2014
- Re: [sympa-developpers] CPAN alternatives for time-related functions, IKEDA Soji, 03/25/2014
- Re: [sympa-developpers] CPAN alternatives for time-related functions, IKEDA Soji, 03/30/2014
-
Re: [sympa-developpers] CPAN alternatives for time-related functions,
David Verdin, 03/25/2014
-
Re: [sympa-developpers] CPAN alternatives for time-related functions,
IKEDA Soji, 03/25/2014
Archive powered by MHonArc 2.6.19+.