Re: [PATCHv5 04/17] diff: introduce more flexible emit function
- From
- Jonathan Tan <jonathantanmy@google.com>
- Date
- Jun 13, 2017, 23:46 UTC
- Message-ID
- <20170613164618.30804543@twelve2.svl.corp.google.com>
- In-Reply-To
- <CAGZ79kY9ByaHe_fx+S3neT6+1LcA_Q13bbVha8AKHUUO32FgeA@mail.gmail.com>
On Tue, 13 Jun 2017 16:41:57 -0700 Stefan Beller <sbeller@google.com> wrote:
Show 30 quoted lines
> On Tue, Jun 13, 2017 at 2:54 PM, Jonathan Tan <jonathantanmy@google.com> wrote:
> > - could this be called emit() instead?
>
> Despite having good IDEs available some (including me)
> very much like working with raw text, and then having a function
> named as a common string doesn't help.
>
> After this patch
>
> $ git grep emit_line |wc -l
> 16
> # not all are this function, there is
> emit_line_checked as well. But 16 is not too much.
>
> But if renamed to emit():
>
> $ git grep emit -- diff.c |wc -l
> 60
>
> You could argue I'd just have to grep
> for "emit (" instead, but that then I would have
> rely on correct whitespacing or use a regex already.
> Complexity which I would not like.
>
> So I am not sure if this is helping a reader. (Not the casual
> reader, but the one grepping for this function)
>
> Maybe we can settle on a different name though,
> such as emit_string which is not a prefix of a dozen
> different other functions?emit_string sounds good to me.