[Bioperl-l] parameter/method naming conventions
Jason Stajich
jason@cgt.mc.duke.edu
Tue, 1 Oct 2002 10:35:13 -0400 (EDT)
A lot of the Bio::Tools::Run:: modules (not written by me) were written
without using leading dashes mostly because people like to use AUTOLOAD to
do the easily set parameters -- or worse they use a mixed collection of w/
and w/o leading dashes. I think these are dealt with separately than
standard constructor parameters. We should probably make a decision/stand
on how we want these to be done in the future.
-jason
On 1 Oct 2002, Heikki Lehvaslaiho wrote:
>
> 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
>
--
Jason Stajich
Duke University
jason at cgt.mc.duke.edu