On 2015-12-30 12:51 PM, Richard Hipp wrote:
> On 12/30/15, Richard Hipp <drh at sqlite.org> wrote:
>> I'll continue look for an alternative way to make the intent of the
>> code clearer.
>
> See https://www.sqlite.org/src/info/1541607d458069f5 for another
> attempt at removing magic numbers.  But I don't like it.  It seems to
> complicate more than it clarifies.  My current thinking is that the
> code should remain as it is on trunk.....

While kludgy itself, a possible compromise is to still use a named constant / 
macro but have '4' in the name of the macro, eg like 'SOME_FOO_4' where the 
SOME_FOO is a semblance of descriptive and the 4 says what the value is so you 
don't have to look it up.  The key thing is that there may be multiple reasons 
to use the value 4 in a program and the named constant is illustrating which 
reason it is.  If you change the value of the constant then you would also 
rename this particular constant to match the new value, but the key thing is 
you 
have something easily look-upable that shows all the 4 are connected. -- Darren 
Duncan

Reply via email to