git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/1] xdiff: provide indirection to git functions

From
Edward Thomson <ethomson@edwardthomson.com>
Date
Feb 17, 2022, 22:58 UTC
Message-ID
<20220217225804.GC7@edef91d97c94>
In-Reply-To
<220217.86ee41izpq.gmgdl@evledraar.gmail.com>
On Thu, Feb 17, 2022 at 10:29:23AM +0100, Ævar Arnfjörð Bjarmason wrote:
> 
> [I'm assuming that dropping the list from CC was a mistake, re-CC-ing]
It was; many apologies, I don't use mutt very often any more.  Thanks!
> As for the "new person to our codebase..." I don't think you're wrong
> there, but that's an asthetic preference, not something that's required
> for the stated aims of this series of dropping in compatibility shims.

Sure, but avoiding a prefix is also not a technical decision but an aesthetic and ergonomic one.

Is using a prefix here great? No, it's not great, it's shit. But it's shit that's easy to reason about.

If somebody sees a call to `xdl_free` in some code, they say "wtf is this `xdl_free` nonsense?" And they grep around and figure it out and understand the way that this project handles heap allocations. It's very transparent.

If somebody sees a call to `free` in their code, they say "great, `free`". But it merely *appears* very transparent; in fact, there's some magic behind the scenes that turns a `free` into a `git__free` without you knowing it. You've not learned the way that this project handles heap allocations, but you also don't know that there's anything that you needed to learn. These are the sorts of things that you think you understand but only discover when you _need_ to discover it because something's gone very wrong.

In my experience, calling a function what it _isn't_ is the sort of thing that a developer discovers the hard way, and that often leads to them not trusting the codebase because it doesn't do what it says it does.

Cheers- -ed

Previous: Junio C HamanoNext: Ævar Arnfjörð Bjarmason
Message 10 of 11 in “xdiff: share xdiff between git and libgit2”
  1. 0/1 xdiff: share xdiff between git and libgit2Edward Thomson, Feb 9, 2022
  2. 1/1 xdiff: provide indirection to git functionsEdward Thomson, Feb 9, 2022
  3. Phillip WoodFeb 9, 2022
  4. Ævar Arnfjörð BjarmasonFeb 15, 2022
  5. Phillip WoodFeb 16, 2022
  6. Ævar Arnfjörð BjarmasonFeb 16, 2022
  7. Johannes SchindelinFeb 17, 2022
  8. Ævar Arnfjörð BjarmasonFeb 17, 2022
  9. Junio C HamanoFeb 17, 2022
  10. Edward ThomsonFeb 17, 2022
  11. Ævar Arnfjörð BjarmasonApr 15, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.