SV: Python Productivity over C++
Christian Tanzer
tanzer at swing.co.at
Wed Jun 14 01:27:41 EDT 2000
Thomas Thiele <thiele at muc.das-werk.de> wrote:
> The only difference I see between developing algorythms in C++ and
> Python is that python needs no time for compiling. But the advantage
> of C++ is that I get the most error messages during compilation (->
> earlier!)
If this is so, then you aren't using Python's full potential.
And as other people pointed out in this stream, C++'s type checking is
overrated. (If you talked about Ada or Eiffel, the situation would be
different but Python would still have strong advantages).
> And I think the developing overhead (algorithms, class design) is
> larger than translation into a special language.
This is definitely not true -- if you are using Python in a pythonic
way.
If you use Python, design and implementation can go hand in hand. In
fact, using a notation like UML just wastes time. This has a lot of
consequences:
- less work to do (instead of drawing diagrams you get working code)
- immediate feedback
- it is much easier to reconsider a specific design decision and
decide on different strategy
Fast feedback and less legacy design result in a better designed
system.
Proceeding in a similar way with C++ would be suicidal -- except for
the tiniest problems. When using C++, you constantly have to consider
lots of issues totally unrelated to the problem to be solved (what
Brooks called accidental complexity). Because that interferes with
the goals of a good design, you first have to make a
language-independent design.
To translate that design into C++, you need a second low-level design
step. With experience, you can do that while implementing -- though I
would still contend that this step needs more effort than
designing/implementing in Python.
The real difference between a Python and a C++ program appears only
after you finished it. Changing a well designed C++ program is much
harder than changing an eqivalent Python program.
--
Christian Tanzer tanzer at swing.co.at
Glasauergasse 32 Tel: +43 1 876 62 36
A-1130 Vienna, Austria Fax: +43 1 877 66 92
More information about the Python-list
mailing list