C++ Logo

std-proposals

Advanced search

[std-proposals] Distinguish between adjectives and verbs

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Wed, 11 Oct 2023 10:56:52 +0100
I'm working on someone else's code at the moment, and there's a bug in it:

    void SomeFunc(void)
    {
        some_container.empty();
    }

He discarded the result of 'empty()', and then I realised that he must
have meant 'clear()'.

The two English words, 'empty' and 'clear' are verbs. Unfortunately
both of them have an identical adjective. And so if an alien arrived
on Planet Earth today and learned to speak English and tried to get
the hang of C++, they wouldn't know the difference between 'clear()'
and 'empty()'.

In future can we please be much more verbose? Either use a word that
stands out as a verb (i.e. its adjective is not identical), or
alternatively prefix the adjective with "is_".

While I'm talking about naming mishaps here -- Did not one person
think that 'std' was an unfortunate combination of letters? Really?

Received on 2023-10-11 09:57:05