[Bioperl-l] method naming

Michael Kiwala mkiwala at watson.wustl.edu
Wed Jun 13 18:27:08 UTC 2007


David Messina wrote:
>> 1) Is there any preference on how to name a method that returns a
>> list of class instances vs. data?  I have seen 'each' (each_Location,
>> each_tag_value) vs. 'get_all' (get_all_tags, get_all_SeqFeatures) vs.
>> simple (hits, hsps).
>>     
>
> I'd prefer 'get_all' because it's more intuitive to me what the  
> method is doing. 'Each' is too programmer-y.
>
>
>   
When I think 'get_all', I think of a method that returns a list of 
objects at once. When I think of 'each', I think of a method that 
returns a scalar but can be called multiple times to iterate over a set 
of objects.





More information about the Bioperl-l mailing list