should i learn it first ?

Aahz Maruch aahz at panix.com
Sun Mar 10 21:30:49 EST 2002


In article <oBTi8.1475$523.127893 at ozemail.com.au>,
Patrick <netlangau at yahoo.com.au> wrote:
>"Aahz Maruch" <aahz at panix.com> wrote in message
>news:a6g7ra$lm6$1 at panix2.panix.com...
>>
>> But are there any tasks for which C++ (or C++/Python) is really better
>> than C/Python?
>
>One example is an extremely complex and long-running simulation in which the
>time-critical components are a very substantial chunk of the project. In
>those (rare) situations you need ruthless efficiency with slightly better
>than rudimentary abstraction capabilities. C++ fits the bill, but only if
>every processor cycle and every byte counts.

Right, and if you've got a project like that, you'd better have someone
like Alex Martelli handy, because otherwise your C++ program will bloat
with every advanced C++ feature you use.  I'd bet that 90% of so-called
C++ programmers would do far better in this case with C/Python.

I once had to deal with a C++ DLL written by a programmer who I had a
decent amount of respect for.  I did not (and do not) know C++, and
don't particularly consider myself a C programmer -- but in a week I'd
used C to rewrite his DLL mostly from scratch.  I removed the
Windows-isms (because I was developing on Solaris), and my code was
shorter, faster, and bugless.  The part I was most aghast about was that
he did the moral equivalent of this:

    buffer = ''
    for tmp_buf in input:
        buffer = buffer + tmp_buf
-- 
                      --- Aahz  <*>  (Copyright 2002 by aahz at pobox.com)

Hugs and backrubs -- I break Rule 6                 http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista

"Argue for your limitations, and sure enough they're yours."  --Richard Bach



More information about the Python-list mailing list