Skip to content
Prev 576 / 21307 Next

[Bioc-devel] Depending vs. Importing?

Without going to your particular example, the main difference as I see
it, is that developers using import can still make the packages usable
in case a dependency is broken.

Suppose your package is intended for some complex analysis (for which it
does not need anything) and can additionally produce some fancy
graphical output of the analysis if it loads a dependency. Now if this
dependency is broken (missing, cannot be compiled etc) - with depends
your package will fail to install; with import the package developer
could have tested for the result and implemented some simple plots if
the dependency is broken - but the package would still work for the
analysis.

If however, the package fails to work completely when it cannot import
something, then such import should go into depends to allow for the
error during the installation time.

Generally, you do not want to make a package totally non-functional if 1
of 10 dependencies fails, therefore it is reasonable to use import for
lesser important features of the package.

Cheers,
  Oleg
Byron Ellis wrote: