[Bioc-devel] best practices for callGeneric()

Hahne, Florian florian.hahne at novartis.com
Sun Jul 22 19:49:07 CEST 2012


Hi Michael,
I have some examples where I delegate by first casting the dispatched
argument and then directly calling the generic again. I assume that is
more or less equivalent to what you are doing, avoiding the readability
issues. The problem with the somewhat obscure argument list remains,
however (unless you explicitly list all formal arguments, but then you
might have to extract them from Š). When reading through the code this
still looks odd because you get the impression that you method is somewhat
recursive. So not sure whether that solution is any better than
callGenericŠ
Florian
-- 






On 7/22/12 11:53 AM, "Michael Lawrence" <lawrence.michael at gene.com> wrote:

>Hi guys,
>
>We often use callGeneric in wrapper methods when delegating. In some ways,
>this is nice, because it conveys the wrapper semantic. However, it can
>also
>be problematic e.g. when searching the code for all calls to a generic,
>since the actual name of the generic is obscured. It's also maybe a little
>tougher to read, because when I see "callGeneric" I have to recall the
>name
>of the generic for the current method. Also, we sometimes use
>callGeneric(), i.e., with no arguments. This is kind of a cool shortcut,
>but it also hurts readability, since it is drawing the arguments from the
>current frame, which we have to construct in our head. Are we having too
>much fun with this function?
>
>Michael
>
>	[[alternative HTML version deleted]]
>
>_______________________________________________
>Bioc-devel at r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/bioc-devel



More information about the Bioc-devel mailing list