Is STL-thinking over-emphasized in C++

Discussion in 'C++' started by Steven T. Hatton, Jul 7, 2005.

  1. 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
    Steven T. Hatton, Jul 7, 2005
    #1
    1. Advertising

  2. Steven T. Hatton

    John Carson Guest

    "Steven T. Hatton" <> wrote in message
    news:
    > 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
    John Carson, Jul 7, 2005
    #2
    1. Advertising

  3. On Thu, 07 Jul 2005 10:56:44 +0400, John Carson
    <> 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
    <>
    Maxim Yegorushkin, Jul 7, 2005
    #3
  4. Steven T. Hatton

    John Carson Guest

    "Maxim Yegorushkin" <> wrote in message
    news:eek:
    > On Thu, 07 Jul 2005 10:56:44 +0400, John Carson
    > <> 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
    John Carson, Jul 7, 2005
    #4
  5. Steven T. Hatton

    Panjandrum Guest

    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.
    Panjandrum, Jul 7, 2005
    #5
  6. "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
    Richard Herring, Jul 7, 2005
    #6
  7. 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.
    --
    <mailto:> <http://www.dietmar-kuehl.de/>
    <http://www.eai-systems.com> - Efficient Artificial Intelligence
    Dietmar Kuehl, Jul 7, 2005
    #7
  8. In article <>,
    Richard Herring <> 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
    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
    Dave Vandervies, Jul 7, 2005
    #8
  9. 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).
    --
    <mailto:> <http://www.dietmar-kuehl.de/>
    <http://www.eai-systems.com> - Efficient Artificial Intelligence
    Dietmar Kuehl, Jul 7, 2005
    #9
  10. Steven T. Hatton

    Stephen Howe Guest

    > 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
    Stephen Howe, Jul 22, 2005
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Homa
    Replies:
    7
    Views:
    443
    John Saunders
    Nov 16, 2003
  2. Replies:
    18
    Views:
    605
    Ioannis Vranos
    Mar 6, 2005
  3. Jeremy
    Replies:
    2
    Views:
    335
    Jeremy
    Nov 27, 2007
  4. Replies:
    0
    Views:
    244
  5. optimistx

    Linear thinking vs essential thinking

    optimistx, Oct 28, 2009, in forum: Javascript
    Replies:
    4
    Views:
    170
    Dr J R Stockton
    Oct 29, 2009
Loading...

Share This Page