emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs rewrite in a maintainable language


From: John Yates
Subject: Re: Emacs rewrite in a maintainable language
Date: Tue, 13 Oct 2015 09:52:34 -0400

On Tue, Oct 13, 2015 at 8:22 AM, Mathieu Lirzin <address@hidden> wrote:
Oleh Krehel <address@hidden> writes:

> For exactly this reason (the confusion over 3 notations, 2 of which are
> the same), I propose that we stick only to "const char *" and "char * const",
> and don't use "char const *".

This seems a good idea to me.  It would be nice for this convention to
be documented somewhere.  I think this can be defined in GNU coding
standards.  Can you send this suggestion to address@hidden?

Standardizing is a good thing. Basing the choice purely on subjective
preference is less so. Many who have looked at the C and C++ grammars
notice that

    const char *

is an historical irregularity that has been folded into the grammar as
a special case. Embracing and standardizing on that special case
detracts from learning a consistent rule and typically leads to
misreading of more complex declarators. The alternative is to leverage
the fact that a const or volatile qualifier always applies to the
object to its left so cv-qualifiers uniformly appear on the right. No
need to remember special case rules or the relative precedence of
various type constructs.  Many C++ well-regarded coding standards
have adopted such a rule (along with moving '*' and '&' leftward).

/john


reply via email to

[Prev in Thread] Current Thread [Next in Thread]