Converting Python code to C/C++

Carl Banks pavlovevidence at gmail.com
Wed Jun 24 21:42:25 EDT 2009


On Jun 24, 7:10 am, Grant Edwards <invalid at invalid> wrote:
> On 2009-06-24, Couper, Tim T <Tim.Cou... at standardbank.com> wrote:
>
> > Your prof. may find this thread of interest
>
> >http://mail.python.org/pipermail/python-list/2000-June/039779.html
>
> > My experience is that developers who know C and C++ can be productive in
> > less than 1 week in python, and find it liberating, and educational, to
> > do so. And at the same time they will have added a second language to
> > their toolbox. As Kurt points out, learning C/C++ takes considerably
> > longer (weeks/months to attain a level of competence).
>
> I agree.  Your professor is deluded and knows nothing about
> software development [not that either is particularly unusual
> in an academic setting].  Converting a Python program to C or
> C++ is a complete waste of time (both now _and_ later) unless
> there are severe, insurmountable performance problems with the
> Python version.

What if the point of asking a student to convert Python to C is to
teach them this:

> Python is a far, far better language for both real-world
> production application development and for algorithm R&D.  With
> Python, you spend your time working on algorithms and solving
> real-world problems.  In C or C++, you spend your time fighting
> with the bugs in your code that are preventing the program from
> running.  An algorithm that takes a few hours to implement and
> test in Python will take weeks in C or C++.

If that [teaching them this] is the case, it might be best use of time
they will ever have.


Carl Banks



More information about the Python-list mailing list