[Numpy-discussion] C++ Example
Mon Mar 5 07:58:33 CST 2012
On Sun, Mar 4, 2012 at 2:18 PM, Luis Pedro Coelho <email@example.com> wrote:
> On Saturday, March 03, 2012 04:38:53 PM David Cournapeau wrote:
>> I don't think the code is comparable either - some of the stuff done
>> in the C code is done in the C++ code your are calling. The C code
>> could be significantly improved.
> Actually, that's not 100% accurate. The C code calls the same functions. Most
> of the extra cruft is that it needs to do all of this error checking and type-
> dispatch, while in C++ you can have RAII and templates.
But most of the code in the C one is not related to either. All the
size computation, etc… still needs to be done somewhere.
While I agree that RAII is by itself a very useful feature, it is not
that used in your example. IMO, all you are doing is comparing decent
C++ to awful C. That's not very interesting to me.
More information about the NumPy-Discussion