From jswinton at Proteom.com  Tue Apr  1 15:33:39 2003
From: jswinton at Proteom.com (Jonathan Swinton)
Date: Tue Apr  1 15:33:55 2003
Subject: [Rd] Old style and new style classes
Message-ID: <54C6B7921595FF40AB81D151FDFB7F4F0AAB5C@fps01.proteom.com>


I have been writing quick and dirty S-plus code for years, but for a recent project I took the plunge, bought Venables and Ripley's S Programming, and implemented a class library using new style classes (in S-Plus 6.0). It worked quite nicely and I am wondering about making more routine use of them. Before I make much more of an investment, I have a few questions, both factual and subjective, that I'd be grateful for opinions on. 

1) I don't use R at the moment, but I might, and might want to target users who do. The documentation at http://cran.r-project.org/doc/manuals/R-lang.pdf seems to suggest that R 1.6.2 supports only old style classes, but http://developer.r-project.org/methodsPackage.html implies that new style classes can be used with the aid of a methods package from John Chambers. Venables and Ripley only describe old-style classes for R and add in their online supplement that there are 'small changes' between S-Plus and R for new style classes. Can the new style class mechanism be used in practice transparently and portably between S-Plus and R?

2) The s-news archives hold a few complaints about the design of the new style classes scattered over the last few years. On mature reflection, do people have opinions about the practical workability of old or new style classes for implementing reusable, object oriented code?

3) There are also some hints (eg top line of http://developer.r-project.org/classIssues.html) that new style classes have not been committed to by some active developers. Is this true? Do new style classes have an active future? Is R committed to them?   Insightful?   

I use old-style (S version3 engine) and new-style (S version4) classes in the sense of Venables and Ripley. 

 -------------------------------------
 Dr Jonathan Swinton
 Proteom Ltd 
 Babraham Hall
 Babraham
 Cambridge CB2 4AT
  www.proteom.com
 
 -----------------------------------


[Rd] Old style and new style classes
Jonathan Swinton