On Thu, Aug 22, 2013 at 2:26 PM, Gabriel Becker <gmbec...@ucdavis.edu>wrote:

> On Thu, Aug 22, 2013 at 2:03 PM, Hadley Wickham <h.wick...@gmail.com>
> wrote:
> >> To avoid the NOTEs (which often triggers a 'pls fix' upon submission to
> >> CRAN), I simply copied/pasted these functions to my package, but this
> seems
> >> wasteful.
>
> >Wasteful of disk space, but disk space is cheap. It's less wasteful of
> >your time, if the referenced code breaks in an unexpected time.  Your
> >time is much more valuable than disk space.
>
> On the other hand, it's quite dangerous software design. What if the
> original author finds a bug and implements a fix, but you don't hear about
> it?
>
> Furthermore, what happens when I come along and need the same
> functionality? Sure I could make a copy, but maybe I only know about your
> copy and don't know it is a copy of something else, so now we have a copy
> of a copy, which is even more problematic. Using ::: prevents this issue.
>

Using ::: on a package you don't control can be more dangerous. For a
package author to choose to export a function to the public interface
represents at least some assurance that that interface will be stable or
slow-moving. But there are no implied assurances about how code in the
private namespace might change behind the scenes. I might completely
refactor the code and change the behavior of any private function between
0.0.1 releases, but I would not do that for exported functions.

Peter

        [[alternative HTML version deleted]]

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to