work in progress | string


proposal for class STRING

Rename feature empty to is_empty

Proposal

Proposal for class STRING:

Rename feature 'empty' to 'is_empty'.

Please select one of the following:

History

Feature is_empty is not present in class ARRAY or STRING in the 1995 standard. However, empty is present in class STRING in the 1995 standard.

Background

is_empty is a convenience feature. It's always possible to test for count > 0 instead.

Rationale

Although the feature name empty has a long history of use in STRING and ARRAY, most users consider is_empty to be a better choice of name. A particular problem with empty is that it can also be a verb - suggesting a command to empty out the STRING or ARRAY.

Dependencies

If empty is renamed to is_empty in STRING, it makes sense to add is_empty to class ARRAY. This is already part of the current proposal for ARRAY.

Discussion

Franck Arnaud (20 October 1999):
What about the transition? STRING.empty is a popular feature, so
he should not disappear to easily. Maybe "empty" should be left in
STRING and is_empty be a synonym. So the choice may be
between:

1. is_empty, empty both there.
2. is_empty replaces empty
3. is_empty, empty obsolete but required at least for ELKS2000

Roger Browne (21 October 1999):
I don't think we need to worry about this. Users prefer that their
existing code does not break, and vendors prefer not to break the
existing code of their users.

I expect all vendors will retain the existing feature until there's no
longer a demand for it. The ELKS standard allows a vendor to include
extra features, and I don't think any further action is needed.

Impact of proposed change

Low.

A vendor may continue to support empty. Alternatively, a vendor may declare empty to be "obsolete" and recommend the use of is_empty instead.

Result

The proposal was accepted.

Voting details

votes cast at eGroups:

Don't mind (happy either way)
                jcm@mstr.hgc.edu
                saunders@wchat.on.ca
                franck.arnaud@omgroup.com
Strongly accept the proposal
                andreas.leitner@teleweb.at
                tking@insystems.com
                jweirich@one.net
                steinman@sco.edu
                vputz@nyx.net
Abstain (not happy either way)
                joachim.durchholz@halstenbach.de
Accept the proposal
                sergei_ivanov@object-tools.com
                manus@eiffel.com
                glennm@westernport.com
                dominique.colnet@loria.fr
                dougpardee@my-deja.com
                kevin@ethossoft.co.nz
                genepi@sympatico.ca
                sparker@eiffel.ie
                simonwillcocks@enterprise.net
                ericb@gobosoft.com
                kwaxer@aha.ru

votes sent to the discussion list:

-

Comments

Joachim Durchholz:

I'm missing the requirement to list 'empty' as an obsolete synonym.
(Hypothetical new vendors should still include 'empty' to remain portable.)

I had to abstain (not happy either way) because of this.