[Rd] C vs. C++ as learning and development tool for R
Ramon Diaz-Uriarte
rdiaz at cnio.es
Fri Jan 19 15:03:42 CET 2007
Dear Mark,
On Friday 19 January 2007 09:55, Kimpel, Mark William wrote:
> I have 3 years of experience with R and have an interest in becoming a
> better programmer so that I might someday be able to contribute
> packages. Other than R, my only experience was taking Lisp from Daniel
> Friedman in the 1970's. I would like to learn either C or C++ for
> several reasons:
>
> To gain a better concept of object oriented programming so that I can
> begin to use S4 methods in R.
>
I do not think C++ is the best idea if you are learning it to understand the
OOP of R. The OOP of R is probably closer to that of CLOS (the common lisp
object system) than C++ and Java.
It might be better to directly go ahead and look for documentation specificaly
about R's OOP.
> To perhaps speed up some things I do repeatedly in R
>
> To be able to contribute a package someday.
>
>
>
> I have been doing some reading and from what I can tell R is more
> compatible with C, but C++ has much greater capabilities for OO
> programming.
>
>
>
> I have just started reading The C++ Programming Language: Special
> Edition by Bjarne Stroustrup
> <http://search.barnesandnoble.com/booksearch/results.asp?ATH=Bjarne+Stro
> ustrup&z=y> , he recommends first learning C++ and then then C if
> necessary, but as a developer of C++, he is probably biased.
>
>
>
> I would greatly appreciate the advice of the R developers and package
> contributors on this subject. "C" or "C++"?
>
>
I'd recommend C instead of C++: C++ is a huge language and it is somewhat
easier to interface C than C++ from R. (In "non-R" stuff I prefer to use C++
better than C, even if just as in "C++as a better C", but this probably is
not a reasonable reason to learn C++).
HTH,
R.
>
> Thanks,
>
>
>
> Mark
>
>
>
> Mark W. Kimpel MD
>
>
>
>
>
> Official Business Address:
>
>
>
> Department of Psychiatry
>
> Indiana University School of Medicine
>
> PR M116
>
> Institute of Psychiatric Research
>
> 791 Union Drive
>
> Indianapolis, IN 46202
>
>
>
> Preferred Mailing Address:
>
>
>
> 15032 Hunter Court
>
> Westfield, IN 46074
>
>
>
> (317) 490-5129 Work, & Mobile
>
>
>
> (317) 663-0513 Home (no voice mail please)
>
> 1-(317)-536-2730 FAX
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
--
Ramón Díaz-Uriarte
Centro Nacional de Investigaciones Oncológicas (CNIO)
(Spanish National Cancer Center)
Melchor Fernández Almagro, 3
28029 Madrid (Spain)
Fax: +-34-91-224-6972
Phone: +-34-91-224-6900
http://ligarto.org/rdiaz
PGP KeyID: 0xE89B3462
(http://ligarto.org/rdiaz/0xE89B3462.asc)
**NOTA DE CONFIDENCIALIDAD** Este correo electrónico, y en s...{{dropped}}
More information about the R-devel
mailing list