[Numpy-discussion] Proposed Roadmap Overview
Sturla Molden
sturla@molden...
Fri Feb 17 22:30:00 CST 2012
Den 18. feb. 2012 kl. 05:01 skrev Jason Grout <jason-sage@creativetrax.com>:
> On 2/17/12 9:54 PM, Sturla Molden wrote:
>> We would have to write a C++ programming tutorial that is based on Pyton knowledge instead of C knowledge.
>
> I personally would love such a thing. It's been a while since I did
> anything nontrivial on my own in C++.
>
One example: How do we code multiple return values?
In Python:
- Return a tuple.
In C:
- Use pointers (evilness)
In C++:
- Return a std::tuple, as you would in Python.
- Use references, as you would in Fortran or Pascal.
- Use pointers, as you would in C.
C++ textbooks always pick the last...
I would show the first and the second method, and perhaps intentionally forget the last.
Sturla
More information about the NumPy-Discussion
mailing list