[Bioperl-l] parameter/method naming conventions
Allen Day
allenday@ucla.edu
Mon, 30 Sep 2002 21:43:21 -0700 (PDT)
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