From: Junio C Hamano <gitster@pobox.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: "Ben Peart" <peartben@gmail.com>, "Jeff King" <peff@peff.net>,
"René Scharfe" <l.s.r@web.de>,
"Andreas Schwab" <schwab@linux-m68k.org>,
"Git List" <git@vger.kernel.org>, "Johannes Sixt" <j6t@kdbg.org>
Subject: Re: [PATCH] strbuf: use designated initializers in STRBUF_INIT
Date: Wed, 12 Jul 2017 14:08:41 -0700 [thread overview]
Message-ID: <xmqqd1951hye.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <87d195zcy0.fsf@gmail.com> ("Ævar Arnfjörð Bjarmason"'s message of "Wed, 12 Jul 2017 21:12:55 +0200")
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> On Tue, Jul 11 2017, Junio C. Hamano jotted:
>
>> Just so that people do not misunderstand, it is not our goal to
>> declare that now you need a fully C99 compiler to build Git.
>> ...
>
> I think in the context of this desire Johannes Sixt's "Actually, I'm
> serious [about let's compile with c++]"[1] should be given some more
> consideration.
> ...
> Most of his patch is just avoiding C++ keywords, e.g. new -> wen, try ->
> try_, this -> this_, namespace -> name_space, template -> templ
> etc. It's going to be relatively easy to avoid a few keywords as
> variable names, especially if we set up CI for it via Travis.
I am not interested at all in building the binary I personally use
with any C++ compiler, but I do not mind too much if people made it
easier for other people to do so, but only if the did it the right
way.
I do like the fact that we call two things we are comparing with a
pair of matching words, 'old' and 'new'. When two variables or
fields have certain relationship, they should be named with words
that have constrasting meaning that explains what they are.
I would very much mind if a "let's make it buildable with C++"
effort made the code compare 'old' and 'wen'. C++ is not that
interesting to sacrifice the readability of the code. Don't invent
non-words like wen; don't truncate a word like 'template' in the
middle to 'templ' to make it unreadable and invite inconsistencies
(e.g. "was it templ, templa, or something else?").
If a "let's make it buildable with C++" effort needs to avoid 'new',
replace *both* 'old' and 'new' to a matching pair of words (perhaps
'pre' and 'post'? but it is making it worse by choosing a pair with
different length. 'one' vs 'two' would be OK if there is no strong
connotation that the 'old' side is always truly older in the
function in question).
I would not mind the result of such an update that much. We already
do use different pair of words in places that we could have used
<old, new> after all.
Having to review too many updates like that in a single sitting
would be annoying, though.
The same thing for where we use 'this'; if the existing code is
contrasting 'this' with 'that', and if your C++ effort wants to
replace 'this', you MUST replace 'that' as well so that we would
still be contrasting a pair of variables appropriately named.
next prev parent reply other threads:[~2017-07-12 21:08 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-10 7:03 [PATCH] strbuf: use designated initializers in STRBUF_INIT Jeff King
2017-07-10 14:57 ` Ben Peart
2017-07-10 16:04 ` Jeff King
2017-07-10 17:57 ` Ben Peart
2017-07-11 5:01 ` Mike Hommey
2017-07-11 15:31 ` Junio C Hamano
2017-07-12 19:12 ` Ævar Arnfjörð Bjarmason
2017-07-12 21:08 ` Junio C Hamano [this message]
2017-07-13 22:24 ` Johannes Sixt
2017-07-10 16:44 ` Junio C Hamano
2017-07-10 17:33 ` Stefan Beller
2017-07-10 21:46 ` Junio C Hamano
2017-07-10 17:10 ` Andreas Schwab
2017-07-10 19:57 ` Johannes Sixt
2017-07-10 20:38 ` Junio C Hamano
2017-07-10 21:11 ` Johannes Sixt
2017-07-10 21:38 ` Junio C Hamano
2017-07-14 16:11 ` Junio C Hamano
2017-07-14 17:13 ` Stefan Beller
2017-07-14 17:36 ` Jeff King
2017-07-14 18:48 ` Junio C Hamano
2017-07-14 19:16 ` Junio C Hamano
2017-07-19 18:19 ` [PATCH] objects: scope count variable to loop Stefan Beller
2017-07-19 18:23 ` Brandon Williams
2017-07-24 17:08 ` Jeff King
2017-07-24 17:12 ` Stefan Beller
2017-07-24 18:05 ` Jeff King
2017-07-14 19:28 ` [PATCH] strbuf: use designated initializers in STRBUF_INIT Ævar Arnfjörð Bjarmason
2017-07-14 22:26 ` Junio C Hamano
2017-07-14 22:43 ` Mike Hommey
2017-07-15 11:08 ` Jeff King
2017-07-11 4:38 ` Jeff King
2017-07-11 0:05 ` brian m. carlson
2017-07-11 0:07 ` Stefan Beller
2017-07-11 0:10 ` brian m. carlson
2017-07-11 5:24 ` Johannes Sixt
2017-07-12 1:26 ` brian m. carlson
2017-07-12 18:25 ` Johannes Sixt
2017-07-10 22:41 ` Brandon Williams
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: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqd1951hye.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=j6t@kdbg.org \
--cc=l.s.r@web.de \
--cc=peartben@gmail.com \
--cc=peff@peff.net \
--cc=schwab@linux-m68k.org \
/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://80x24.org/mirrors/git.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).