Documentation, more, more -- momentary digression on R, EToys, subclassing, and other things

Michael Grant mwgrant2001 at yahoo.com
Thu Sep 11 12:20:24 UTC 2003


--- "Richard A. O'Keefe" <ok at cs.otago.ac.nz> wrote:
> "mwgrant2001" <mwgrant2001 at yahoo.com> wrote:
	  
> 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".  

I have made some variants of 'summary' on occasion,
but that is about it.

(In any case,
> someone who _really_
> wants to dig around in the R sources has to read R,
> C, and Fortran
> fluently.) 

I've avoided that aspect, though I am an old FORTRAN
dragon--it hurts to see machines you used in the
Smithsonian!)

>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.

Yes, I think that says it very well. There are a
couple of things that I particularly like about
programming in R. First, I can prototype very quickly
by going from a small code snippet into an application
with output tables and PS graphics. Second, so much of
my code has been re-useable. (Of that may have more to
do with doing similar tasks from job to job.)

I've played with the Sweave package--I really like
that. I'm an environmental consultant and the prospect
of generating documentation and coding in the same
source code has appeal. I need to explore that some
more.

> 
> 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.
> 

Looking at EToys (and the source) is on my list but I
don't know if I'll ever get there. Without really
knowing anything about it I have wondered if EToy
analogs could be useful in some of the professions.
Maybe with databases, small production systems, demons
and the like attached. The motivation is that the
misapplication of models in my business (groundwater,
atmospheric fate and transport)occurs quite often. The
off-the-self codes are inexpensive so it is easy to
buy them and have inexpierencedjunior personnel run
them. 

Of course one would ultimately need qualitative
reasoning capabilities, but that may not be
unreasonable for some areas in environmental modeling.
(Yeah, I am in the wrong business ain't I? However,
the nice thing about looking at this stuff as an
avocation is that I can do attempt whatever I want
when I want. Of course time and knowledge a bit of a
problem.)


> 	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

Same here. The behavior of 'mean' changed with a new
version. Unfortunately I used old version code with
and updated R. But I have to admit I over-reacted to
the zapping. (I got both mild rebukes and kudos on the
side!!!) Having followed the forum for a time now, I
really have a lot of sympathy for those guys. Abuse
includes delving into statistical questions (not R)
and submittal of some things that look like homework!
Given the volume of legitimate questions on the forum,
that stuff have wear thin at times.

BTW I remember your initiation and thought it was
definitely unwarranted. Our English friend has some
bad days but he is sharp and has contributed so, so
much to that project. (Very nice in private, non-forum
communications too.) 

> 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.)

I've only tried the demo in Windows. Early days there
were problems getting to work but it seem more smooth
now. I think the Windows R/TkTcl linkage has probably
gotten some of the wrinkles removed as version numbers
have increased.

> 
> 	> (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.  

In that case it's going to be kinda hard to get out of
the starting blocks... ;-) 

>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.
> 

Thank your council. You and David have been very
helpful. Guess I better try to do something, huh?

> 	Yea, I've done this at the method implementation
> level as I've added 
> 	some statistical and sampling methods to
> Collections.
> 
> Any M-estimators?

No. I was just beginning to work on implementing some
USEPA statistical protocols. I had was also looking at
that with some 'computer intensive' stuff. I asked a
forum question on generating lists of all permutations
of a collections earlier this. Among the replies I
received, you warned how this could rapidly get out of
hand as sample size increases. True. As it was, my
interest was driven by need to handle SMALL sample
sizes. However, the reply made me think that it would
be wise to limit sample size for such a method.

FYI, the thing driving a lot of my interest in Squeak
is to built an complete risk assessment environment in
Squeak and to GNU it. I'm also thinking about one in
R. People in my business tend to use either
spreadsheets or 3rd party codes which generally do not
include source code. And that is unhealthy from a
quality point of view. The idea is to encourage a risk
assessment community based on open source codes.

Oh well, enough. Cheers,
Mike

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com



More information about the Squeak-dev mailing list