🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Nico Josuttis Fri, 12 Apr 1996 14:57
STL/String naming scheme confusion
#4003
Author: Nico Josuttis
Date: Fri, 12 Apr 1996 14:57
49 lines
2371 bytes
Hi,
Foregive me if I am wrong and sorry, if this sounds like a flame,
but if I try to find a naming scheme for STL
search/find algorithms, it all seems to be a confusion:

Consider:
                         | basic_string       | STL algorithm
-----------------------------------------------------------------
find first elem          | find()             | find()
find last elem           | rfind()            | - 
find first subrange      | find()             | search()
find last subrange       | rfind()            | find_end()
find first elem of range | find_first_of()    | find_first_of()
find last elem of range  | find_last_of()     | -

Why don't we use the string naming scheme ?
 - Why is search() not also called find() ?
 - Why is find_end() not called rfind() ?

  (I guess the missing algorithms do miss because
   reverse iterators do the job)

OK, we had not many time but this is somehow typical
for inconsistences in the library and happened of course due
to historical reasons.
For example to append elements, we have
 +=, append, push_back

But it would be possible to get more conistence with only a bit of
work. I think programmers will thank for it (oh certainly they won't,
but they won't flame so much).
And this is the last chance to make it more consistent.

Anything but historical reason against a change for that ?
Am I missing something ?

If not, I could try to make a full table for all such naming
inconsistences to have a base to discuss a consistent solution.

Nico
nico@bredex.de


[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]
Re: STL/String naming scheme confusion
#4046
Author: Rich Paul
Date: Mon, 15 Apr 1996 16:37
26 lines
1674 bytes
Nico Josuttis wrote:
> Why don't we use the string naming scheme ?
>  - Why is search() not also called find() ?
>  - Why is find_end() not called rfind() ?
> 
>   (I guess the missing algorithms do miss because
>    reverse iterators do the job)
> 

Without judging which one is better, I'd be quite inclined to 
agree that a single naming scheme would be much nicer to deal 
with!


-- 
#include <legalbs/standarddisclaimer>
Rich Paul                |  If you like what I say, tell my
C++, OOD, OOA, OOP,      |  employer, but if you don't,
OOPs, I forgot one ...   |  don't blame them.  ;->
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu 
]
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads