I actually prefer C++, since I know it and it's as fast as C when you use it as C, and sometimes faster when you understand its compilation model. But the extension APIs for both R and Perl (and many other languages) are written in C, not C++, and C is a much simpler language. | [reply] |
So does learning C, or C++, help you learn the other? And what would be the advantage of knowing the same language as what the extension APIs are in? My knowledge level is such that I just looked up what API is, though I've seen it plenty but just never really knew what it was.
| [reply] |
So does learning C, or C++, help you learn the
other?
Yes -- C++ is mostly a superset of C, so learning either helps you
learn the other.
And what would be the advantage of knowing the same
language as what the extension APIs are in?
The idea is that you first write your program in a comfortable,
high-level, slow language (e.g. R or Perl) and then, if it's too slow,
reimplement parts of it in a fast language, calling those parts from
the high-level language.
| [reply] |