[Bioperl-l] printing UnivAlgn

Hilmar Lapp hlapp@gmx.net
Sun, 17 Dec 2000 23:35:52 -0800

Ewan Birney wrote:
> >
> > -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"

Java naming style is nice, but C++ is either. What confused me in
Bioperl and still does from time to time is that both are mixed, like

Still, I'm probably not the only developer who appreciates it if a
package has *consistent* naming style ...

> 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.

I agree regarding the performance. I even like the dual purpose style.

> > -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...

I still find the each_ style confusing and counter-intuitive. For
instance, each_tag_value() is ambiguous in the first place: does it mean
the value(s!) of each tag (in the sense of all tags), or each (in the
sense of all) value(s) of a particular tag?

Anyway, apart from flattening your learning curve, the each_ style is
not incomprehensible ... ;)

Hilmar Lapp                                email: hlapp@gmx.net
GNF, San Diego, Ca. 92122                  phone: +1 858 812 1757