[Bioperl-l] use of no_* to mean 'number_of', negative booleans

Chris Fields cjfields at illinois.edu
Tue Jun 9 16:19:03 EDT 2009


On Jun 9, 2009, at 2:12 PM, Robert Buels wrote:

> Why not just add deprecation warnings now?  Or you could add  
> deprecation warnings now that only print if  
> $Bio::Root::Version::VERSION >= something.  Best to do it while one  
> is thinking about it, I always say.  Cause I always forget to do it  
> later.  ;-)
>
> Rob

Actually, that's one thing I want to implement within Root, namely the  
ability to do this:

$self->deprecated(-message     => 'method Foo is deprecated',
                   -start_ver   => $version1,
                   -throw_ver   => $version2
);

So it's essentially a noop and invisible up to start_ver (upon where  
it warns), then throws after, well, throw_ver.  I could probably  
finagle that in w/o destroying things...

chris

> Chris Fields wrote:
>> We could probably alias nof_* with num_* just for consistency, but  
>> leave nof_* as is and not deprecate it (I don't think anyone would  
>> confuse nof* with no*).
>> chris
>> On Jun 9, 2009, at 1:41 PM, Florent Angly wrote:
>>> Agree! no_* is prone to misunderstandings.
>>> Also, some BioPerl code uses nof_*, which I quite like.
>>> Florent
>>>
>>> Hilmar Lapp wrote:
>>>> Great suggestions, I'm all for it.
>>>>
>>>>   -hilmar
>>>>
>>>> On Jun 9, 2009, at 12:08 PM, Chris Fields wrote:
>>>>
>>>>> All,
>>>>>
>>>>> I've noticed a few methods in bioperl with names like 'no_Foo'  
>>>>> that mean 'number of Foo' (such as SimpleAlign's no_sequences).   
>>>>> The problem I foresee are possible ambiguities, particularly  
>>>>> with negative boolean checks (eg 'no_Foo' could also mean 'this  
>>>>> instance contains no Foo'), something that BioPerl also has with  
>>>>> various settings.
>>>>>
>>>>> I suggest we alias these as num_* to disambiguate that.  There's  
>>>>> no easy way to change already in-place flag setting w/o going  
>>>>> through a deprecation cycle, but we can promote using positive  
>>>>> booleans where possible (eg 'is_foo' or 'has_foo' instead of  
>>>>> 'no_foo').  We can leave the older 'no_*' methods as is for the  
>>>>> time being and maybe deprecate them later.
>>>>>
>>>>> If no one has objections I'll add these in as needed.
>>>>>
>>>>> chris
>>>>> _______________________________________________
>>>>> Bioperl-l mailing list
>>>>> Bioperl-l at lists.open-bio.org
>>>>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>>>
>>>
>>> _______________________________________________
>>> Bioperl-l mailing list
>>> Bioperl-l at lists.open-bio.org
>>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>
>
> -- 
> Robert Buels
> Bioinformatics Analyst, Sol Genomics Network
> Boyce Thompson Institute for Plant Research
> Tower Rd
> Ithaca, NY  14853
> Tel: 503-889-8539
> rmb32 at cornell.edu
> http://www.sgn.cornell.edu



More information about the Bioperl-l mailing list