Re: STL / Qt flame-war (Re: [linux-audio-dev] Audio-related widgets with Qt ?)

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: STL / Qt flame-war (Re: [linux-audio-dev] Audio-related widgets with Qt ?)
From: Joe Pfeiffer (pfeiffer_AT_cs.nmsu.edu)
Date: Mon Sep 17 2001 - 20:03:20 EEST


>Sorry, IMHO STL exemplifies the phrase ``too clever by half.'' It
>really needed another round of design before being released... as my
>favorite example of ``things that bit me,'' if you cast a forward
>iterator to a reverse iterator you get, not an iterator pointing to
>the same list element, but one pointing to the previous list element.
>On the other hand, when you cast a reverse iterator to a forward
>iterator you get... oops! can't do that!

   cast a forward iterator to a reverse iterator? what in the world were
   you thinking? do actually mean cast, or do you mean construct a
   reverse iterator using a forward iterator?

Yes, I mean construct a reverse iterator using a forward iterator.
Sorry, sloppy terminology.

>The STL concept is very powerful, but its implementation is so full of
>unexpected inconsistencies that it is a royal PITA.

   *an* implementation, rather than *its* implemenation. i have my
   complaints about the GNU implementation, and i've heard other things
   about the Rogue implementation as well. but i've heard similar things
   about many other kinds of libraries, and that doesn't stop me from
   using them. it means that i work around them. for example, i know that
   the GNU List::size() function is O(n), which is sometimes
   unacceptable. So I work around it with a counter variable, and if
   necessary, a mutex (which is needed anyway for MT work with the STL,
   since the objects themselves are not MT-safe, but can be derived from
   to make them so when appropriate; a much more efficient approach than
   building locks in all over the place).

Actually, I was unclear when I said ``implementation,'' and it was a
poor choice of wording. I didn't mean the code implementing the STL, I
mean the embodiment of the concepts of things like iterators into the
particulars of the STL -- the sorts of things I was referring to in my
last post, which aren't going to go away.

-- 
Joseph J. Pfeiffer, Jr., Ph.D.       Phone -- (505) 646-1605
Department of Computer Science       FAX   -- (505) 646-1002
New Mexico State University          http://www.cs.nmsu.edu/~pfeiffer
SWNMRSEF:  http://www.nmsu.edu/~scifair


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Mon Sep 17 2001 - 20:02:49 EEST