The source does not document intent. I, too disagree with Dr Ripley on this point. The library mechanism insists that some attempt at documentation be included with the source, for good reason.
I would rather the documentation assert intent to support negative rounding values and later add the caveat that it may not be achievable in all cases than not mention the option at all. It is much easier to critique the code and documentation together than depend purely on the algorithmic expressions in the code... I may wonder if the author intended the code to have some odd corner case behavior in order to meet a performance goal. Documentation that addresses that helps, and documentation that doesn't may simply be mysterious. Documentation that disagrees with the code prompts repairs... of the code, or the documentation. --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnew...@dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. Duncan Murdoch <murdoch.dun...@gmail.com> wrote: On 11-10-11 7:14 PM, Rolf Turner wrote: > On 11/10/11 08:17, Michael Friendly wrote: >> On 10/9/2011 6:18 AM, Prof Brian Ripley wrote: >>> >>> Sometimes it is better not to document things than try to give precise >>> details which may get changed *and* there will be useRs who misread (and >>> maybe even file bug reports on their misreadings). The source is the >>> ultimate documentation. >> >> I can't agree with this less. The source does the computation. The >> documentation says how to use it and what it should do. Corner cases >> can be trapped in code or mentioned in Notes. But the source is >> only useful if you can easily find it and then can understand what it is >> doing, particularly for a .Primitive like round(). >> The source is only the documentation of last resort. > > I agree. It seems to me that saying that the source is the ultimate > documentation > is rather like (in pure mathematics) saying that all maths follows from the > Zermello-Fraenkel axioms plus the Axiom of Choice, so those axioms are > all that we > need to tell anyone. R is an open source project. That means we expect people to look at the source, to answer some of their own questions, to suggest improvements, to point out errors. If you don't look at it, you aren't holding up your side of the bargain. Duncan Murdoch _____________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.