[Bioperl-l] parameter/method naming conventions

Heikki Lehvaslaiho heikki@ebi.ac.uk
01 Oct 2002 09:33:16 +0100


Allen,

All public constructors really should be using dashed parameters.
Changing that would break every bioperl script in the world.

Could you provide a list of modules which use non-dashed parameters.
I'd be curious to have a look.

	-Heikki

On Tue, 2002-10-01 at 05:43, Allen Day wrote:
> Hi All,
> 
> Hilmar has been cleaning up the get/set method names to make them 
> consistent across the Bio::* classes, and I was wondering what can be done 
> about parameter conventions, such as those passed to new().  It looks like 
> some of the modules are using non-dashed parameters:
> 
> Class->new(a=>1,b=>2)
> 
> some are using dashed parameters:
> 
> Class->new(-a=>1,-b=>2)
> 
> and some can accept either.  It isn't always clear to me what form to pass
> without poring over the manpage for the details.
> 
> How do people feel about stripping out leading dashes?  I wasn't too 
> unhappy with this until I've started using 
> Class::MakeMethods::Emulator::MethodMaker to (among other things) create 
> all my get/set methods.
> 
> perl -e "sub -function(){}" #error
> 
> Unfortunately, method names can't start with dashes. One of the nice
> things with C::M::E::M is you can just pass a list of fields for which
> get/set methods will be created, and the method names can conform to
> whatever convention we like based on the field name.
> 
> -Allen
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
-- 
______ _/      _/_____________________________________________________
      _/      _/                      http://www.ebi.ac.uk/mutations/
     _/  _/  _/  Heikki Lehvaslaiho          heikki@ebi.ac.uk
    _/_/_/_/_/  EMBL Outstation, European Bioinformatics Institute
   _/  _/  _/  Wellcome Trust Genome Campus, Hinxton
  _/  _/  _/  Cambs. CB10 1SD, United Kingdom
     _/      Phone: +44 (0)1223 494 644   FAX: +44 (0)1223 494 468
___ _/_/_/_/_/________________________________________________________