C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Distinguish between adjectives and verbs

From: Breno Guimarães <brenorg_at_[hidden]>
Date: Wed, 11 Oct 2023 07:08:39 -0300
'empty()' being marked [[no discard]] addresses this issue.

Frederick, this is not a proposal. You may want to move some of these
topics to a C++ channel on discord or slack.

Best regards,
Breno G

Em qua., 11 de out. de 2023 06:57, Frederick Virchanza Gotham via
Std-Proposals <std-proposals_at_[hidden]> escreveu:

> 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?
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2023-10-11 10:08:50