Documentation, more, more

Richard A. O'Keefe ok at cs.otago.ac.nz
Thu Sep 11 04:54:45 UTC 2003


"mwgrant2001" <mwgrant2001 at yahoo.com> wrote:
	Richard O'Keefe gave an excellent description of the R environment, 
	documentation, and site (item 69542 " Re: Documentation, more, 
	more  " above). I also use the online help frequently...it is easy 
	and productive. I mildly disagree with one thing he said, however. 
	Programming work can and is done in R (S). It is vectorized, loaded 
	with math capabilities, and for those reasons is an excellent general 
	purpose language for number crunching. 
	  
I didn't say that R _can't_ be used for programming work, or even that
it _isn't_.  I still have a copy of Octave, but now that I have R I
just don't find myself using Octave any more.

What I said is that R has a lot of users who aren't particularly
_interested_ in programming, they just want to get results they can use
in their real job, and that those people benefit greatly from something
better than "look at the source".  (In any case, someone who _really_
wants to dig around in the R sources has to read R, C, and Fortran
fluently.)  My points is that although R _is_ a programming environment,
for many people it is more like an "application", which has something to
do with what kinds of documentation are useful/appropriate/tolerated.

There's an analogue in Squeak, and that's the stuff people do with EToys.
You _can_ program in Squeak, very well indeed, but many of the people
using EToys would not be helped greatly by looking at the Squeak sources.

	There is another significant difference that Richard politely did not 
	point out. The Squeak forum is consistently friendly and enthusiatic. 
	The R help forum occasionally has cutting responses from some of the 
	guru's.

Yep.  I've been on the wrong end of that a couple of times, starting with
the very first question I ever asked.  (I installed R on a Solaris box
which _does_ have tcl/tk.  The R install decided that it did, and then
again, that it didn't, so that when I tried to use an R package that
calls Tcl/Tk I was allowed to try but it crashed.  I'd just followed the
standard installation instructions, no deviations, and the guru made me
feel like a real idiot for asking.  I _still_ can't use Tk from R.)

	> (a negative example - almost
	> never subclass collections, they're intended to be used, not
	> subclassed).
	
	Thank you. This is very helpful. Though I seem to recall advice in 
	one or more other OO languages saying do just the opposite.

Betrand Meyer, in OOSC2, says plainly that he thinks it is a good idea
for STACK to be a subclass of ARRAY.  Practically the only thing about
that book I dislike (although his review of other languages is biased
and incorrect in some cases).

There's a good rule of thumb that will keep you out of a lot of trouble:
never make a subclass of a class you don't understand.  For example, it
_does_ make sense to make a collection subclass, but you shouldn't do it
until you understand _all_ the collection protocol that you have to make
work for your new class.

One nice thing about Smalltalk is that you don't _have_ to make subclasses
of system classes.  For example, I've several times needed to make my own
input or output streams, but have never been able to subclass Stream or any
of its subclasses.  Stream has a bit too much in it.  That doesn't matter:
as long as my stream class implements all the methods in the protocol(s) I
need, it doesn't _have_ to inherit from Stream.

	And it was just the prospect of subclassing to subclasses in the 
	large 'crystalline' ST system that was making me nervous--it 
	intuitively seems hazardous here. 
	
If I want something that is like a Java Vector but has a few more
operations, and I want it to be usable anywhere a Vector is usable,
then it *has* to be a subclass of Vector.  You can do this in Java 1.2,
but you had better know everything about Vector.  (One machine here has
/usr/java1.2/src.jar, another machine doesn't.  Too bad about anyone
trying to extend Vector on the second machine, eh?)  But if you want
to make something like an OrderedCollection but somewhat different,
you DON'T have to subclass OrderedCollection, you can start there or
anywhere above it in the class hierarchy, even Object, as long as you
implement all the necessary methods.
	
	Yea, I've done this at the method implementation level as I've added 
	some statistical and sampling methods to Collections.

Any M-estimators?
	



More information about the Squeak-dev mailing list