Skip to content
Prev 5941 / 21312 Next

[Bioc-devel] Confusing namespace issue with IRanges 1.99.17

On 07/08/2014 11:58 AM, Leonardo Collado Torres wrote:
Honestly I don't know why so many BioC packages do that. But it seems
to be a strong trend. IMHO it's a lot of work for very little benefits.
Doesn't seem to make a big difference from a loading time perspective.
However it makes the NAMESPACE big and adds some unnecessary overhead
to the overall maintainability of the package. For example, when some
low-level functionality moves from one package to the other (like it
happened recently with the Rle class), then all the BioC packages that
selectively import stuff from IRanges need to have their NAMESPACE
fixed.

I've heard some people claiming they do it to minimize the risk of a
name collision. Fair enough. But name collisions are pretty rare.
A simple and straightforward approach is to import full packages
until a name collision issue actually happens. For most packages,
it will never happen. But if it happens, you'll get a warning at
both: installation- and load-time, so you can't miss it. Then you can
adjust the NAMESPACE by selectively importing from one of the 2
packages involved in the collision.

The selective imports is sometimes pushed to the extreme: I've seen
BioC packages trying to selectively import stuff from the methods
package! There is probably zero benefit in doing this, only maintenance
complications in the long run... Also I think I remember reading
somewhere (R-devel list? R official doc? Can't remember exactly)
that packages are not supposed to do that.

My 2 cents. I'm sure not everybody will agree with this.

H.