[Bioperl-l] Feature/Annotation rollback finished

Florent Angly florent.angly at gmail.com
Thu Aug 30 03:44:58 UTC 2007


Hilmar Lapp wrote:
> Keep in mind that code such as
>
> 	if ($ann) { ... }
>
> is mostly not b/c someone wanted to use overloading, but rather  
> someone was lazy and really meant to say
>
> 	if (defined($ann)) { ... }
>
> In the absence of eq overloading, these will behave identically. So  
> if you leave the exceptions in it is sort-of policing lazy  
> programmers, which I guess is fine in principle, but is guaranteed to  
> trip up a lot of script code. I'd take it out if you're reasonably  
> sure that at least within BioPerl itself those lazy programming  
> incidents are removed.
	if ($ann) { ... }

and 

	if (defined($ann)) { ... }

are not the same.

	if ($ann)

is evaluated false for an empty string like

        $ann = '';

and for a value of zero, i.e.

	$ann = 0;

while

	defined($ann)

returns true in these 2 cases.

Florent




More information about the Bioperl-l mailing list