Python Productivity over C++

Rainer Deyke root at rainerdeyke.com
Wed Jun 14 17:06:18 EDT 2000


Wim Lavrijsen <wlav at hpatl26.cern.ch> wrote in message
news:8i7frt$o02$1 at sunnews.cern.ch...
> "Rainer Deyke" <root at rainerdeyke.com> writes:
> >This statement is both incorrect and misleading.
>
> Bold words.
>
> >Incorrect because there
> >may be other requirements: for example, std::set (along with several
others)
> >requires that operator< and operator== are defined for the object.
>
> Nonsense. You can specialize std::set with your own version of comparison
> class instead of the standard less and you can make sure that your version
> of it does not require said operators.

True, but writing your own comparison class is at least as much work as
implementing operator <.  Besides, IIRC you still need operator ==.

> >Misleading because for many classes the compiler generated functions
cause
> >incorrect behavior.
>
> As I have explained in another post, 'many' is only true for buggy code
> that is not exception safe.

For some values of 'many'.  Smart pointers can help, but the smart pointer
classes themselves almost always need explicit copy contructors and operator
=, and if you deal with a variety of objects and resources you'll need a
variety of smart pointers.  For example, COM objects would need their own
smart pointer class.  Then there are classes for which copy and assignment
operations simply don't make sense - nodes in a linked list for example (and
don't tell me to use STL for linked lists - this was only an example).

> Of course, your statements only underline the original point, that is,
that
> the STL is to difficult to use for C++ novices. However, although it has
> its flaws, the STL is well designed and all the simple things have been
> taken care of real good.

I actually agree with this.


--
Rainer Deyke (root at rainerdeyke.com)
Shareware action/role-playing games      -      http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor





More information about the Python-list mailing list