Re: Patch: iff -> if

Поиск
Список
Период
Сортировка
От David G Johnston
Тема Re: Patch: iff -> if
Дата
Msg-id 1397613132639-5800172.post@n5.nabble.com
обсуждение исходный текст
Ответ на Re: Patch: iff -> if  (Thom Brown <thom@linux.com>)
Список pgsql-hackers
Thom Brown-2 wrote
> On 15 April 2014 23:19, Andreas 'ads' Scherbaum <

> adsmail@

> > wrote:
>>
>> Hi,
>>
>> stumbled over a number of "iff" in the source where "if" is meant - not
>> sure
>> what the real story behind this is, but attached is a patch to fix the
>> about
>> 80 occurrences.
>>
>> This only appears in comments, not in any code path.
> 
> Yeah, apparently those are intentional, and mean "if and only if" (i.e.
> <=>)

Just looking at the first few items someone's good intention is being ruined
by bad execution...especially:

"Add...references to the section...a block is in [iff] chapters aren't
autolabelled..."

Many of these are not mathematical propositions but flow-control logic for
which "IF" is indeed the correct term-of-art; though re-reading the example
above that is probably one of the more logical ones...

Now:

"...new tuple was inserted, and its HEAP_ONLY_TUPLE flag is set [if/iff] a
HOT update was done"

needs to be evaluated on its merits; namely does HEAP_ONLY_TUPLE ever get
set if a HOT update was not done?  If not then "IFF" is proper and necessary
to convey that fact (though even this one is marginal and both versions are
likely unambiguous in reality).

In short "returns BOOLEAN" can reasonably be said to properly use "IF" in
almost all cases - especially for those functions that are check-oriented
(and thus obviously if the opposite condition is present the opposite result
would be returned).  "IFF" is not incorrect here but for me is misplaced and
too-much-information.

Given that it is unlikely the mis/over-use of IFF in the comments is a
meaningful problem I would vote for letting the imprecision go and avoid the
code churn.  If the surrounding code was being altered anyway then having
the corresponding comment updated seems acceptable; but a blanket
find/replace doesn't seem helpful.

David J.




--
View this message in context: http://postgresql.1045698.n5.nabble.com/Patch-iff-if-tp5800153p5800172.html
Sent from the PostgreSQL - hackers mailing list archive at Nabble.com.



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Christopher Browne
Дата:
Сообщение: Re: Patch: iff -> if
Следующее
От: "sure.postgres"
Дата:
Сообщение: The question about the type numeric