From: Akib Azmain Turja <akib@disroot.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>,
Phil Sainty <psainty@orcon.net.nz>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: [C source] Inconsistent comments on preprocessor conditionals
Date: Mon, 11 Jul 2022 18:42:04 +0600 [thread overview]
Message-ID: <87y1wz2543.fsf@disroot.org> (raw)
In-Reply-To: <jwv8rp3gz9x.fsf-monnier+emacs@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 1509 bytes --]
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> The "#endif /* not FOO */" version provides the extra information that
>> there *is* an "#else" clause -- which might be helpful if the clauses
>> are spaced very far apart. If "#endif /* FOO */" is then consistently
>> used only for cases with no "#else", some code may be (very) slightly
>> easier for people to parse.
>
> FWIW, I personally never trust whether the comment is positive or
> negative; instead the comment only tells me that it's the else/endif
> that matches the condition that has to do with FOO (as opposed to some
> other `#if` that tests something different), so the presence/absence of
> `not` doesn't make much difference for me. Maybe it's because of a lack
> of a clear and religiously followed convention.
>
> Also, those comments tend to get out of sync with the code, of course.
>
> IOW, I'd rather not have those comments and let Emacs generate that info
> dynamically, so it's always up-to-date and reliable.
>
>
> Stefan
>
Yes, comments are actually hints, and they can get out of sync. But I
usually study programs relatively much new, which is written once and
the working parts are never touched again. Comments there are usually
up to date. But for the almost half a century old source code of Emacs,
this is not true.
--
Akib Azmain Turja
This message is signed by me with my GnuPG key. It's fingerprint is:
7001 8CE5 819F 17A3 BBA6 66AF E74F 0EFA 922A E7F5
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
next prev parent reply other threads:[~2022-07-11 12:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-08 12:47 [C source] Inconsistent comments on preprocessor conditionals Akib Azmain Turja
2022-07-08 12:55 ` Eli Zaretskii
2022-07-08 13:33 ` Phil Sainty
2022-07-08 13:37 ` Eli Zaretskii
2022-07-08 13:55 ` Akib Azmain Turja
2022-07-08 14:01 ` Eli Zaretskii
2022-07-08 14:21 ` Phil Sainty
2022-07-08 16:28 ` Sergey Organov
2022-07-08 19:54 ` Stefan Monnier
2022-07-11 12:42 ` Akib Azmain Turja [this message]
2022-07-08 12:57 ` Po Lu
2022-07-08 13:47 ` Alan Mackenzie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y1wz2543.fsf@disroot.org \
--to=akib@disroot.org \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=psainty@orcon.net.nz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).