[boost.range] renaming empty() to is_empty()

Dear all, John Torjo asks why don't rename the Range concepts empty() function to the more idiomatic and less embarrassing name is_empty()? My initial thoughts were if this could ceate more confusion, but I'm beginning to think John is right. So if people would cast some yes or no votes it would be great. br Thorsten

Thorsten Ottosen ha escrito:
Dear all,
John Torjo asks why don't rename the Range concepts empty() function to the more idiomatic and less embarrassing name is_empty()?
My initial thoughts were if this could ceate more confusion, but I'm beginning to think John is right.
So if people would cast some yes or no votes it would be great.
I'd vote no (i.e., I'd stick with empty). It is admittedly a bad name, but it's even worse to depart from STL terminology. I don't think it'll pose that many problems since anybody who delves into Boost.Range will be already familiar with STL containers and the empty() memfun. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

I'd vote no (i.e., I'd stick with empty). It is admittedly a bad name, but it's even worse to depart from STL terminology. I don't think it'll pose that many problems since anybody who delves into Boost.Range will be already familiar with STL containers and the empty() memfun.
Second that. Regards, Jurko

On Fri, Sep 03, 2004 at 10:16:39AM +0200, Thorsten Ottosen wrote:
Dear all,
John Torjo asks why don't rename the Range concepts empty() function to the more idiomatic and less embarrassing name is_empty()?
My initial thoughts were if this could ceate more confusion, but I'm beginning to think John is right.
So if people would cast some yes or no votes it would be great.
Hmm ... the function takes its argument by const-reference, so it's "obvious" it doesn't empty the range if you've seen the function declaration. (But anything "obvious" will fail to be obvious to some people). Although it would be nice if the STL had used is_empty() it's too late to change that now, and Boost's web site does say: The emphasis is on libraries which work well with the C++ Standard Library. I think consistency with the existing name is important. jon -- "The tools we use have a profound (and devious!) influence on our thinking habits, and, therefore, on our thinking abilities." - Edsger Dijkstra

Jonathan Wakely wrote:
On Fri, Sep 03, 2004 at 10:16:39AM +0200, Thorsten Ottosen wrote:
Dear all,
John Torjo asks why don't rename the Range concepts empty() function to the more idiomatic and less embarrassing name is_empty()?
My initial thoughts were if this could ceate more confusion, but I'm beginning to think John is right.
So if people would cast some yes or no votes it would be great.
Hmm ... the function takes its argument by const-reference, so it's "obvious" it doesn't empty the range if you've seen the function declaration. (But anything "obvious" will fail to be obvious to some people).
Although it would be nice if the STL had used is_empty() it's too late to change that now, and Boost's web site does say:
The emphasis is on libraries which work well with the C++ Standard Library.
And how would range lib not work well with STL from this point of view?
I think consistency with the existing name is important.
I'm all for consistency myself, but keeping up a bad standard, while many experts say the name is wrong, is just perpetuating bad practice. Best, John -- John Torjo Freelancer -- john@torjo.com Contributing editor, C/C++ Users Journal -- "Win32 GUI Generics" -- generics & GUI do mix, after all -- http://www.torjo.com/win32gui/ -- v1.3beta released - check out splitter/simple_viewer, a File Explorer/Viewer all in about 200 lines of code! Professional Logging Solution for FREE -- http://www.torjo.com/code/logging.zip (logging - C++) -- http://www.torjo.com/logview/ (viewing/filtering - Win32) -- http://www.torjo.com/logbreak/ (debugging - Win32)

From: "Thorsten Ottosen" <nesotto@cs.auc.dk>
John Torjo asks why don't rename the Range concepts empty() function to the more idiomatic and less embarrassing name is_empty()?
My initial thoughts were if this could ceate more confusion, but I'm beginning to think John is right.
So if people would cast some yes or no votes it would be great.
I think is_empty() is better. As a mf, empty() is a poor name. As a non-member function, it is worse. Why perpetuate a bad thing just for consistency? "A foolish consistency is the hobgoblin of little minds," said Ralph Waldo Emerson. -- Rob Stewart stewart@sig.com Software Engineer http://www.sig.com Susquehanna International Group, LLP using std::disclaimer;
participants (7)
-
Joaquín Mª López Muñoz
-
John Torjo
-
Jonathan Wakely
-
Jurko Gospodnetic
-
Rob Stewart
-
Stefan Slapeta
-
Thorsten Ottosen