Python training time (was)

Mongryong Mongryong at sympatico.ca
Tue Feb 4 17:17:54 EST 2003


On Tue, 2003-02-04 at 16:02, Brandon Van Every wrote:
> I think a more useful question is "What kind of problem do you need to be
> working on, for Python to eventually become more productive than you'll ever
> be in C++?"

The infamous 80/20 rule would suggest that:

Your program spends 80% of its CPU time executing 20% of the code.  That
is, 20% of your code is "real" and the remaining 80% is "gobbledygook". 
Thus, one could argue that it would make sense to use Python for that
gobbledygook part and C/C++ for the real heavy duty part.  This argument
of course depends on whether you believe Python is more efficient for
development.

If you look at most big projects that started out as pure Python, you'll
see that as the project matures, components of the project are
'translated' to C/C++ for optimization.  Twisted and 4Suite come to
mind.  As your project matures, you learn more about the projects
characteristics and "hot spots", thus you can better optimize it using
C/C++.  I personally can't stand it when programmers want to waste their
time optimizing code that barely ever gets executed because it really
makes no difference.

I also must add, in my opinion, for some one to truly understand and
appreciate the Python language, they must have a knowledge of why it
came into existance.  At some point, if the 'newbie' is serious in
understanding the 'magic' behind Python, they'll have to learn about
C/C++ and how a computer works.  I personally would not trust a Python
programmer who didn't have any experience with C/C++.










More information about the Python-list mailing list