[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Use of '""' overload in Dpkg::Interface::Storable



Hello,

On sekmadienis 21 Vasaris 2010 22:23:47 Raphael Hertzog wrote:
> Hi Modestas,
> 
> On Sun, 21 Feb 2010, Modestas Vainius wrote:
> > I suggest you dropping this overload as generally it might be very tricky
> > and there is not much benefit over explicit method call. For example, if
> > $storable was an object of Dpkg::Interface::Storable type 'if
> > ($storable)' would trigger this overload. Probably use of 'defined' would
> > help here to avoid it but it is far from obvious. There might be other
> > cases and contexts where this overload is triggered pointlessly as well.
> 
> Please use the mailing list to discuss dpkg matters. At least we can get
> some more feedback.
> 
> I honestly don't see a valid reason to remove the overload in your
> argumentation. If it starts to cause some specific problems, we can either
> fix the code or add a supplementary overload in the problematic object
> (the "bool" one in your case).

My main argument against was that sometimes it is hard to guess how the $var 
will be evaluated in the particular context. That might result in subtle bugs 
and WTF moments which make code harder to read or debug. But that's just my 
opinion, nothing major.

-- 
Modestas Vainius <modestas@vainius.eu>

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: