Re: [PATCH v6 3/3] bisect--helper: `write_terms` shell function in C
- From
Pranit Bauva <pranit.bauva@gmail.com>
- Date
- May 23, 2016, 14:33 UTC
- Message-ID
- <CAFZEwPPbCBAXq6ri1Ew8-+vY-iAJKtyJB_Nf+Syv4WB+2ktc1w@mail.gmail.com>
- In-Reply-To
- <alpine.DEB.2.20.1605231301560.4122@virtualbox>
Hey Johannes,
On Mon, May 23, 2016 at 4:37 PM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 26 quoted lines
> Hi Pranit, > > On Fri, 20 May 2016, Pranit Bauva wrote: > >> Frankly, I have no idea what you mean by libification but I will use >> error() since efforts for libification have already started. > > The term "libification" is frequently used in the Git project: it means to > convert code that was formerly used in a standalone program to make it > usable as a library function. > > The main differences: > > - in the standalone program, you can get away with calling die() when > anything goes wrong. Not so in a library function: you need to give the > caller a chance to fail gracefully, or even to continue. > > - in a standalone program, you can be sloppy and "let exit() clean up", > i.e. omit free() calls or even close() calls. In library functions, this > is not possible. > > - in a standalone program, you may mess with the stdio handles. This is > an absolute no-go in library functions. > > There are other differences, of course. The gist is that you have to be a > lot more careful for library functions.
Thanks for the explanation. It seems a bit clearer to me now.
Regards, Pranit Bauva
> > Ciao, > Johannes