Subject: Re: bug#48264: [PATCH v3 03/15] Add and use BUFFER_DEFAULT_VALUE_P

From: Spencer Baugh <[email-masked]>
Date: Fri, 07 May 2021 08:49:59 -0400

Eli Zaretskii <[email-masked]> writes:
>> From: Spencer Baugh <[email-masked]>
>> Date: Thu,  6 May 2021 17:33:34 -0400
>> Cc: Spencer Baugh <[email-masked]>
>> 
>> This makes the code more clear and allows us to more easily change how
>> this property is determined.
>
> Does it?  Can you explain why you think so?  It looks like we are
> replacing clear code with an equally clear different code.

Well, "if (idx > 0)" as a conditional requires a fair bit of digging in
the implementation of DEFVAR_PER_BUFFER variables to understand.  On the
other hand, "if (BUFFER_DEFAULT_VALUE_P (offset))" is immediately clear:
We're checking if this variable has a default value.

By hiding the implementation detail of "idx", we both remove the need to
know what idx is, and make it easier to later change the implementation
(as a later commit does).