[Bioperl-l] printing UnivAlgn

Ewan Birney birney@ebi.ac.uk
Sun, 17 Dec 2000 12:27:11 +0000 (GMT)


On Sun, 17 Dec 2000, Murad Nayal wrote:

> 
> Thank you Peter. There are a couple of applications that I want to code
> using bioperl. I will probably wait till the completion of this work
> before I suggest major changes. I am thinking that that this experience
> will probably be a good source of ideas as to what additional facilities
> might be useful in 'the' Alignment object. I will certainly post the
> propositions to the list before I start hacking away.

Great. You've got a login, so - post before any big commits and discuss
things here where there could be controversy, but in general whoever codes
it, wins...

> 
> I kind of was wondering about the bioperl coding style (these questions
> did not seem to be answered in the docs).
> 
> -it seems people like the C++ over the java style in naming functions.
> i.e. function name words are small letter throughout and separated by an
> underscore. but this is not universally true in bioperl code. I really
> like the 'java' style where you capitalize the first letter of every
> word (except the first) and no underscore. is there a 'bioperl' standard
> in this regard?
> 

This is what I tend to write. I do prefer underscores. I reserve
captialisation to mean "Object" like "SimpleAlign"

> -what seems to be very consistent style in bioperl is the use of a dual
> purpose accessor/mutator function that have the same name as the
> associated property. The issue that I have with this approach is that
> you are spending runtime resources to resolve something (whether the
> function was used as an accessor or a mutator) that was well defined at
> compile time. as a result I prefer usually to use separate
> accessor/mutator functions i.e. getProperty() and setProperty(). (again,
> the java influence). I know it is more of a hassle to write two
> functions instead of one, but still.
> 

In a *long* time of profiling bioperl code, I have never seen an accessor
being a peformance bottleneck. I think a dual get/set is fine.


> -functions that return a set of objects are named using differing
> conventions in bioperl. one convention that I like is for a function
> that say returns a set of alignments is just to be named getAlignments()
> as opposed to names like each_alignment() which I have found confusing
> since it sounds like representing an internal iterator that you have to
> call repeatedly to iterate through the sequence (similar to the each
> keyword in perl).
> 
> 

The each_ syntax is my fault. I still like it, but I know that it is not
universally loved. get_Alignments would be probably the ideal I think...



> anyway, just random thoughts trying to get clear about the 'style
> biases' of the group.
> 
> Regards,
> 
> Murad Nayal
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
> 

-----------------------------------------------------------------
Ewan Birney. Mobile: +44 (0)7970 151230, Work: +44 1223 494420
<birney@ebi.ac.uk>. 
-----------------------------------------------------------------