Re: [PATCH 02/12] Convert starts_with() to skip_prefix() for option parsing
- From
Jeff King <peff@peff.net>
- Date
- Dec 28, 2013, 09:54 UTC
- Message-ID
- <20131228095440.GA24166@sigill.intra.peff.net>
- In-Reply-To
- <xmqqha9vct0x.fsf@gitster.dls.corp.google.com>
On Thu, Dec 26, 2013 at 11:27:10AM -0800, Junio C Hamano wrote:
Show 8 quoted lines
> > I still need consensus on the name here guys, parse_prefix. > > remove_prefix or strip_prefix? If no other opinions i'll go with > > strip_prefix (Jeff's comment before parse_prefix() also uses "strip") > > Yup, that comment is where I took "strip" from. When you name your > thing as "X", using too generic a word "X", and then need to explain > what "X" does using a bit more specific word "Y", you are often > better off naming it after "Y".
FWIW, the reason I shied away from "strip" is that I did not want to imply that the function mutates the string. But since nobody else seems concerned with that, I think "strip" is fine.
-Peff