generics rule (was Re: New Python User Question about Python.)

Alex Martelli aleax at aleax.it
Mon Aug 27 05:51:14 EDT 2001


"Christian Tanzer" <tanzer at swing.co.at> wrote in message
news:mailman.998816920.4899.python-list at python.org...
    ...
"""
Grant Griffin <not.this at seebelow.org> wrote:
    [snipped]
Your statement about the rarity of generic programming might apply to
you (although I doubt it) but in general its just plain wrong.
"""

Seconded.  Signature-based polymorphism is very natural and
spontaneous: just as soon as good C++ programmers are introduced
to it, they tend to jump on it and use it in preference to
inheritance-based polymorphism wherever possible -- despite
the practical issues with debugging templates in C++, etc.
This is my experience as a teacher of C++ and consultant on
C++ issues, as well as that of C++ expert user.

Specifically, getting in contact with the Standard C++ Library
(often misnamed the STL) and such additional libraries as Boost
(www.boost.org) and the ATL (Microsoft's best framework for COM
in Visual C++ 6) is generally sufficient for the "introduced to
it" part.  As soon as one is using the Standard Library, ATL,
etc, a very large part of one's coding becomes generic (based
on templates) just to get maximum mileage out of those excellent
frameworks/libraries.  Of course, that goes for Python as well,
where almost everything you do enjoys signature-based polymorphism
(except where durned *type tests* deliberately break things!-).


Alex (Brainbench MVP for C++)






More information about the Python-list mailing list