Re: [RFC PATCH 1/1] Add a type for errors
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 3, 2024, 16:05 UTC
- Message-ID
- <xmqqwmipi342.fsf@gitster.g>
- In-Reply-To
- <CAPig+cQjk5_VJ-LNc9Hx3Q4n6H5bgg5cAztWhFpuweG8wFTjMw@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 8 quoted lines
> Your proposal uses Rust as a model to justify the API choice in this
> RFC, but Phillip's point was that -- despite being perfectly suitable
> in Rust -- it is _not_ ergonomic in C.
> ...
> That's why I said in my original response that I didn't understand
> your response to Phillip. You seem to be using a non-justification
> ("other programmers suffer, so Git programmers can suffer too") as a
> justification for a non-ergonomic design.The statement may be a bit too harsh, as some may not even realize that they are suffering anymore, after prolonged exposure to these idioms, just like C folks consider it is a fact of life that they have to carefully manage their pointers and the memory they point at.
I do agree that "return value with more details in the out parameter whose address is supplied by the caller" is a convention that is easier to grok when written in C.
Thanks.