Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Is STL-thinking over-emphasized in C++

Reply
Thread Tools

Is STL-thinking over-emphasized in C++

 
 
Steven T. Hatton
Guest
Posts: n/a
 
      07-07-2005
I've encountered some design concepts lately which provide useful features,
but probably won't conform to certain STL guarantees such as no-throws on
certain operations, or supporting all the copy construction, or iterator
requirements. I believe any kind of container that makes it's way into the
Standard is either going to completely conform, or come very close.
tr1::array<> comes to mind as an example which, I believe, does not conform
100% to STL container requirements.

I have the sense that many C++ programmers believe every container type
should conform to the STL requirements. Is that a realistic observation?
Is it a good idea? Could there be another set of specified requirement for
a collection of library containers that would address a different design
need, and still provide predictable, reliable behavior?
--
If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in which we never know what we
are talking about, nor whether what we are saying is true.-Bertrand Russell
 
Reply With Quote
 
 
 
 
John Carson
Guest
Posts: n/a
 
      07-07-2005
"Steven T. Hatton" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)
> I've encountered some design concepts lately which provide useful
> features, but probably won't conform to certain STL guarantees such
> as no-throws on certain operations, or supporting all the copy
> construction, or iterator requirements. I believe any kind of
> container that makes it's way into the Standard is either going to
> completely conform, or come very close. tr1::array<> comes to mind as
> an example which, I believe, does not conform 100% to STL container
> requirements.
>
> I have the sense that many C++ programmers believe every container
> type should conform to the STL requirements. Is that a realistic
> observation?


Well, stacks and queues don't satisfy the requirements. I haven't heard a
clamor to have them banned.

> Is it a good idea? Could there be another set of
> specified requirement for a collection of library containers that
> would address a different design need, and still provide predictable,
> reliable behavior?


Of course.

--
John Carson


 
Reply With Quote
 
 
 
 
Maxim Yegorushkin
Guest
Posts: n/a
 
      07-07-2005
On Thu, 07 Jul 2005 10:56:44 +0400, John Carson
<(E-Mail Removed)> wrote:

[]

>> I have the sense that many C++ programmers believe every container
>> type should conform to the STL requirements. Is that a realistic
>> observation?

>
> Well, stacks and queues don't satisfy the requirements. I haven't heard
> a clamor to have them banned.


Neither are they containers. Rather they are adapters.

--
Maxim Yegorushkin
<(E-Mail Removed)>
 
Reply With Quote
 
John Carson
Guest
Posts: n/a
 
      07-07-2005
"Maxim Yegorushkin" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)
> On Thu, 07 Jul 2005 10:56:44 +0400, John Carson
> <(E-Mail Removed)> wrote:
>
> []
>
>>> I have the sense that many C++ programmers believe every container
>>> type should conform to the STL requirements. Is that a realistic
>>> observation?

>>
>> Well, stacks and queues don't satisfy the requirements. I haven't
>> heard a clamor to have them banned.

>
> Neither are they containers. Rather they are adapters.



They are not STL containers, they are STL adapters (by definition, nothing
can be a STL container if it doesn't satisfy the requirements for STL
containers). They are, however, containers in the generic sense.

--
John Carson

 
Reply With Quote
 
Panjandrum
Guest
Posts: n/a
 
      07-07-2005
Steven T. Hatton wrote:
> I have the sense that many C++ programmers believe every container type
> should conform to the STL requirements. Is that a realistic observation?
> Is it a good idea? Could there be another set of specified requirement for
> a collection of library containers that would address a different design
> need, and still provide predictable, reliable behavior?


Take a look at real-world C++ programs, eg. at http://sourceforge.net/
.. You'll find that STL-thinking is not over-emphasized in real C++
projects (quite contrary). It's just over-emphasized in C++ newsproups.
Firstly, because STLs enormous usability problems, secondly, because it
attracts many "gurus" who use STL as playground for their worldshaking
improvements.

 
Reply With Quote
 
Richard Herring
Guest
Posts: n/a
 
      07-07-2005
"Rapscallion"/"Panjandrum"/choose_your-own-morph trolled
>Steven T. Hatton wrote:
>> I have the sense that many C++ programmers believe every container type
>> should conform to the STL requirements. Is that a realistic observation?
>> Is it a good idea? Could there be another set of specified requirement for
>> a collection of library containers that would address a different design
>> need, and still provide predictable, reliable behavior?

>
>Take a look at real-world C++ programs, eg. at http://sourceforge.net/
>. You'll find that STL-thinking is not over-emphasized in real C++
>projects (quite contrary). It's just over-emphasized in C++ newsproups.
>Firstly, because STLs enormous usability problems,


As they say:

Name 5.

>secondly, because it
>attracts many "gurus" who use STL as playground for their worldshaking
>improvements.
>

Wouldn't know about that. Me, I just use STL containers to avoid
reinventing the wheel, because they offer well-documented performance
guarantees, and because I can reasonably assume they are well-tested,
stable and robust.

--
Richard Herring
 
Reply With Quote
 
Dietmar Kuehl
Guest
Posts: n/a
 
      07-07-2005
Richard Herring wrote:
> "Rapscallion"/"Panjandrum"/choose_your-own-morph trolled
> As they say:
>
> Name 5.


Don't bother: I asked about details about problems and/or their
cure before without getting any information back from the
Illuminated.
--
<(E-Mail Removed)> <http://www.dietmar-kuehl.de/>
<http://www.eai-systems.com> - Efficient Artificial Intelligence
 
Reply With Quote
 
Dave Vandervies
Guest
Posts: n/a
 
      07-07-2005
In article <(E-Mail Removed)>,
Richard Herring <(E-Mail Removed)> wrote:
>"Rapscallion"/"Panjandrum"/choose_your-own-morph trolled


>>Firstly, because STLs enormous usability problems,

>
>As they say:
>
>Name 5.


I'll start:
(1) You need to actually learn something before you can use it effectively


(Never mind that the same applies to the language in general, or any
other language or tool you care to name. Nobody else seems to care
about that little detail.)


dave

--
Dave Vandervies http://www.velocityreviews.com/forums/(E-Mail Removed)
Actually I've had a really hard time not saying "Which one of us
is on crack today?", but I've been trying to be polite to people
today online. --Ben Pfaff in comp.lang.c
 
Reply With Quote
 
Dietmar Kuehl
Guest
Posts: n/a
 
      07-07-2005
Steven T. Hatton wrote:
> I have the sense that many C++ programmers believe every container type
> should conform to the STL requirements. Is that a realistic observation?


I hope not. After all, the container concepts are not that useful in the
first place, especially when it comes to specialized behavior. However,
it is likely that even specialized containers provide access using
appropriate sequence concepts (whether these are those which are
currently in the C++ standard or a future refinement thereof).
--
<(E-Mail Removed)> <http://www.dietmar-kuehl.de/>
<http://www.eai-systems.com> - Efficient Artificial Intelligence
 
Reply With Quote
 
Stephen Howe
Guest
Posts: n/a
 
      07-22-2005
> Take a look at real-world C++ programs, eg. at http://sourceforge.net/
> . You'll find that STL-thinking is not over-emphasized in real C++
> projects (quite contrary). It's just over-emphasized in C++ newsproups.
> Firstly, because STLs enormous usability problems...


I have seen you claim this before. What usability problems?
And since you are not sold on the STL, what do you recommend as an
alternative and why?
Note, whatever you recommend, you will have to defend.

>..., secondly, because it attracts many "gurus" who use STL as playground
>for their worldshaking
> improvements.


Well any improvements are a good thing.

Stephen Howe



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments