Patch: iff -> if

Lists: pgsql-hackers
From: Andreas 'ads' Scherbaum <adsmail(at)wars-nicht(dot)de>
To: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Patch: iff -> if
Date: 2014-04-15 22:19:08
Message-ID: 534DB05C.2010306@wars-nicht.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


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.

Regards,

--
Andreas 'ads' Scherbaum
German PostgreSQL User Group
European PostgreSQL User Group - Board of Directors
Volunteer Regional Contact, Germany - PostgreSQL Project

Attachment Content-Type Size
iff.patch text/x-patch 59.5 KB

From: Thom Brown <thom(at)linux(dot)com>
To: "Andreas 'ads' Scherbaum" <adsmail(at)wars-nicht(dot)de>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: iff -> if
Date: 2014-04-15 22:26:22
Message-ID: CAA-aLv4cVTT4L54uBUaRB6tONCxtbwc7TFwP3smxEBaticaM5g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 15 April 2014 23:19, Andreas 'ads' Scherbaum <adsmail(at)wars-nicht(dot)de> 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. <=>)

--
Thom


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Thom Brown <thom(at)linux(dot)com>
Cc: Andreas 'ads' Scherbaum <adsmail(at)wars-nicht(dot)de>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: iff -> if
Date: 2014-04-16 00:36:50
Message-ID: 534DD0A2.8070603@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 04/15/2014 06:26 PM, Thom Brown wrote:
> On 15 April 2014 23:19, Andreas 'ads' Scherbaum <adsmail(at)wars-nicht(dot)de> 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. <=>)
>

This is a reasonably common idiom, or used to be.

cheers

andrew


From: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>, Thom Brown <thom(at)linux(dot)com>
Cc: Andreas 'ads' Scherbaum <adsmail(at)wars-nicht(dot)de>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: iff -> if
Date: 2014-04-16 01:16:11
Message-ID: 534DD9DB.7090507@pinpointresearch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 04/15/2014 05:36 PM, Andrew Dunstan wrote:
>
> On 04/15/2014 06:26 PM, Thom Brown wrote:
>> On 15 April 2014 23:19, Andreas 'ads' Scherbaum
>> <adsmail(at)wars-nicht(dot)de> 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. <=>)
>>
>
> This is a reasonably common idiom, or used to be.

If it has fallen into disuse the news has failed to reach me:

http://en.wikipedia.org/wiki/If_and_only_if
http://www.mathwords.com/i/if_and_only_if.htm
http://mathworld.wolfram.com/Iff.html
...

Cheers,
Steve


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Thom Brown <thom(at)linux(dot)com>, "Andreas 'ads' Scherbaum" <adsmail(at)wars-nicht(dot)de>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: iff -> if
Date: 2014-04-16 01:35:11
Message-ID: 9421.1397612111@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Steve Crawford <scrawford(at)pinpointresearch(dot)com> writes:
> On 04/15/2014 05:36 PM, Andrew Dunstan wrote:
>> On 04/15/2014 06:26 PM, Thom Brown wrote:
>>> Yeah, apparently those are intentional, and mean "if and only if"

>> This is a reasonably common idiom, or used to be.

> If it has fallen into disuse the news has failed to reach me:
> http://en.wikipedia.org/wiki/If_and_only_if
> http://www.mathwords.com/i/if_and_only_if.htm
> http://mathworld.wolfram.com/Iff.html

The last discussion about this suggested that non-English speakers
might be familiar with other abbreviations for the concept.
But anyway, yes, those are not typos.

regards, tom lane


From: Christopher Browne <cbbrowne(at)gmail(dot)com>
To: "Andreas 'ads' Scherbaum" <adsmail(at)wars-nicht(dot)de>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: iff -> if
Date: 2014-04-16 01:39:51
Message-ID: CAFNqd5VqZaO2Z8qeV4P5dTEFC7M4P+L_fTvPXuq83NHsFhqX=w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Apr 15, 2014 at 6:19 PM, Andreas 'ads' Scherbaum <
adsmail(at)wars-nicht(dot)de> 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.
>
>
"IFF" is a common idiom in mathematics (and logic, which means it will be
of interest in computer science, which shares boundaries with both) which
stands for "If And Only If".

Unless it has very recently fallen out of fashion in mathematics, it's
almost certainly intentional to use "iff" in the comments, and not merely a
typo.
--
When confronted by a difficult problem, solve it by reducing it to the
question, "How would the Lone Ranger handle this?"


From: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Patch: iff -> if
Date: 2014-04-16 01:52:12
Message-ID: 1397613132639-5800172.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Thom Brown-2 wrote
> On 15 April 2014 23:19, Andreas 'ads' Scherbaum &lt;

> adsmail@

> &gt; 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.


From: Andreas 'ads' Scherbaum <adsmail(at)wars-nicht(dot)de>
To: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: iff -> if
Date: 2014-04-16 09:12:11
Message-ID: 534E496B.3050403@wars-nicht.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 04/16/2014 12:19 AM, Andreas 'ads' Scherbaum wrote:
>
> 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.

Looks like I missed something in my math lessons ...

--
Andreas 'ads' Scherbaum
German PostgreSQL User Group
European PostgreSQL User Group - Board of Directors
Volunteer Regional Contact, Germany - PostgreSQL Project


From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: "Andreas 'ads' Scherbaum" <adsmail(at)wars-nicht(dot)de>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: iff -> if
Date: 2014-04-17 05:00:25
Message-ID: CAB7nPqSxPc-df4wj5kTeH=jZPcCo+5U5+3JoWnoZfN9R_kdvfA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, Apr 16, 2014 at 6:12 PM, Andreas 'ads' Scherbaum
<adsmail(at)wars-nicht(dot)de> wrote:
> On 04/16/2014 12:19 AM, Andreas 'ads' Scherbaum wrote:
>>
>>
>> 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.
> Looks like I missed something in my math lessons ...
Is there no equivalent in German? For example in French there is "ssi".
--
Michael


From: Nicolas Barbier <nicolas(dot)barbier(at)gmail(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: "Andreas 'ads' Scherbaum" <adsmail(at)wars-nicht(dot)de>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: iff -> if
Date: 2014-04-17 10:33:04
Message-ID: CAP-rdTb=MX4kOAzPLYJz_zHEnEJedeo63J3i0Eh=Rf_D9nEB-g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

2014-04-17 Michael Paquier <michael(dot)paquier(at)gmail(dot)com>:

> Is there no equivalent in German? For example in French there is "ssi".

gdw (genau dann, wenn)

Nicolas

--
A. Because it breaks the logical sequence of discussion.
Q. Why is top posting bad?


From: Andreas 'ads' Scherbaum <adsmail(at)wars-nicht(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Patch: iff -> if
Date: 2014-04-17 21:20:30
Message-ID: 5350459E.8070008@wars-nicht.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 04/17/2014 12:33 PM, Nicolas Barbier wrote:
> 2014-04-17 Michael Paquier <michael(dot)paquier(at)gmail(dot)com>:
>
>> Is there no equivalent in German? For example in French there is "ssi".
>
> gdw (genau dann, wenn)

More likely that you see

\equiv

or:

\leftrightarrow

Regards,

--
Andreas 'ads' Scherbaum
German PostgreSQL User Group
European PostgreSQL User Group - Board of Directors
Volunteer Regional Contact, Germany - PostgreSQL Project


From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Nicolas Barbier *EXTERN*" <nicolas(dot)barbier(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Andreas 'ads' Scherbaum <adsmail(at)wars-nicht(dot)de>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: iff -> if
Date: 2014-04-18 07:08:25
Message-ID: A737B7A37273E048B164557ADEF4A58B17CF1799@ntex2010i.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Nicolas Barbier wrote:
> 2014-04-17 Michael Paquier <michael(dot)paquier(at)gmail(dot)com>:
>> Is there no equivalent in German? For example in French there is "ssi".
>
> gdw (genau dann, wenn)

Sorry, but I as a German native speaker and mathematitian have never
encountered this abbreviation. I am familiar with "iff" though.

I think there just isn't a widely known German equivalent, and
(as Andreas has mentioned) symbols are usually used in writing.

Yours,
Laurenz Albe