git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Johannes Sixt <j6t@kdbg.org>,
	Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org
Subject: Re: [PATCH 1/1] Add a helper to reverse index_pos_to_insert_pos()
Date: Wed, 09 Oct 2019 20:44:27 +0900	[thread overview]
Message-ID: <xmqqeezmkusk.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <nycvar.QRO.7.76.6.1910091015090.46@tvgsbejvaqbjf.bet> (Johannes Schindelin's message of "Wed, 9 Oct 2019 10:17:58 +0200 (CEST)")

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> FWIW I actually agree with Junio about the helper, but in hindsight I
> could have used a better name (not one that is tied to the "index").
> Something like `unsigned_one_complement()`. But of course, that would
> say _what_ it does, not _why_.

I personally feel that the particular name is on the better side of
the borderline.  "st_add3(a, b, c)" says it is about adding three
size_t quantities, without saying why it exists and should be used
over a+b+c.  Existence of the helper and calling it alone should be
a good enough sign that we somehow feel a+b+c is not sufficient [ly
safe], so we do not call it st_add3_safe() or st_add3_wo_overflow().

Your unsigned-one-complement would fall into the same category, no?

  reply	other threads:[~2019-10-09 11:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-08  6:48 [PATCH 0/1] Fallout from azure-pipelines-msvc Johannes Schindelin via GitGitGadget
2019-10-08  6:48 ` [PATCH 1/1] Add a helper to reverse index_pos_to_insert_pos() Johannes Schindelin via GitGitGadget
2019-10-08 21:03   ` Johannes Sixt
2019-10-09  1:19     ` Junio C Hamano
2019-10-09  5:51       ` Johannes Sixt
2019-10-09  8:17         ` Johannes Schindelin
2019-10-09 11:44           ` Junio C Hamano [this message]
2019-10-09 11:59             ` Johannes Schindelin
2019-10-09 12:09               ` Junio C Hamano
2019-10-09  8:11       ` Johannes Schindelin
2019-10-09  8:15     ` Johannes Schindelin

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=xmqqeezmkusk.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=j6t@kdbg.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).