Is this a true statement: Part III

Alex Martelli aleaxit at yahoo.com
Thu Jul 5 16:50:06 EDT 2001


"Steve Horne" <sh at ttsoftware.co.uk> wrote in message
news:qq69kt8id8j4j8rbo75871ikcdk3bpnuos at 4ax.com...
    ...
> C (or a C-like subset of C++) is more appropriate for smaller systems
> with no more than a few thousand lines of code - and development will
> be faster in such cases because there are fewer structuring decisions
> to consider. Not only will the development time be faster, but the
> code will be smaller, and will run a little faster too - in some cases

Most of the times, even in systems as small as this, you can make
productive use of template libraries (www.boost.org, ATL for COM
servers, the Standard library, ...) and cut a factor of 2 to 3 (more,
for a small-enough system!) from your source size and development
time -- design goes much *faster* because you fit in the groove of
the framework (concept to tested code time for a typical small COM
server: C++ with ATL 2 days, Python 2 days, C 10 days -- assuming
*EXCELLENT* mastery of lots of obscure API's in the C case:-).

When I write a Q&D Python extension with the Boost Python Library
(and the rest of boost &c of course) I observe a similar though
not-so-extreme set of ratios: 1/2 a day for original Python
prototype, 1 day for the C++ version, 2 days for the C API one
(again assuming EXCELLENT mastery of the C API, versus perhaps
some rustiness with Boost Python, which I had not used for a
while).  I think if I hadn't written the intermediate C++ version
it might have taken me 3 days for the C one anyway, because I
learned some things doing it (I *know* I would have wasted more
than the 1/2 day the Python prototype took, if I hadn't done it:-).


Alex






More information about the Python-list mailing list