Python's "only one way to do it" philosophy isn't good?
Neil Cerutti
horpner at yahoo.com
Sat Jun 16 15:53:38 EDT 2007
On 2007-06-16, Paul Rubin <http> wrote:
> Neil Cerutti <horpner at yahoo.com> writes:
>> I vote for C++ as being astoundingly complex. But it provides
>> complex features, e.g.,the machanisms it provides to deal with
>> multiple inheritance, or generic, type-safe code.
>
> It gets off-topic but I'm not sure what advantage templates are
> supposed to have over ML-like polymorphism.
I don't know that much about ML. I know is does a really nice job
of generic containers, as does C++. But can it 'foo' any type as
easily as C++?
template <class T> T foo(T);
As an aside, templates are abusable for many sorts of valuable
compile-time computations and type arithmetic, though I'd never
write that code myself--it looks like death.
C++ templates allow for fancy duck-typing in C++, which Python
programmers love. The STL is a good example of the power of
duck-typing (though it oughta been called quack-typing).
--
Neil Cerutti
More information about the Python-list
mailing list