develooper Front page | perl.datetime | Postings from January 2003

Re: Parser Interface (Was Re: Picking up the ball)

Thread Previous | Thread Next
From:
Martijn van Beers
Date:
January 14, 2003 03:56
Subject:
Re: Parser Interface (Was Re: Picking up the ball)
Message ID:
20030114115537.GA6244@erebor.copa.nl
On Mon, Jan 13, 2003 at 09:14:25PM -0600, Dave Rolsky wrote:
> On Mon, 13 Jan 2003, Matthew Simon Cavalletto wrote:
> > Looking at the two alternatives, does the second really seem clearer?
> >
> >    use DateTime;
> >    my $dt = DateTime->new( 'MySQL' => $mysql_dt );
> >    print $dt->to_string( 'MySQL' );
> >
> >    use DateTime;
> >    use DateTime::Parse::MySQL;
> >    my $dt = DateTime->from_mysql_datetime( $mysql_dt );
> >    print $dt->to_mysql_string();
> 
> Um, yeah, the second is _much_ clearer.  And its less error prone as well!
Um, no it isn't.

> Your first option is not on the table.
Let's put it on the table then. Much better than the other options.


Martijn

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About