Обсуждение: Patch: iff -> if
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
Вложения
On 15 April 2014 23:19, Andreas 'ads' Scherbaum <adsmail@wars-nicht.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
On 04/15/2014 06:26 PM, Thom Brown wrote: > On 15 April 2014 23:19, Andreas 'ads' Scherbaum <adsmail@wars-nicht.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
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@wars-nicht.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
Steve Crawford <scrawford@pinpointresearch.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
On Tue, Apr 15, 2014 at 6:19 PM, Andreas 'ads' Scherbaum <adsmail@wars-nicht.de> wrote:
--
When confronted by a difficult problem, solve it by reducing it to the
question, "How would the Lone Ranger handle this?"
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?"
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.
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
On Wed, Apr 16, 2014 at 6:12 PM, Andreas 'ads' Scherbaum <adsmail@wars-nicht.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
2014-04-17 Michael Paquier <michael.paquier@gmail.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?
On 04/17/2014 12:33 PM, Nicolas Barbier wrote: > 2014-04-17 Michael Paquier <michael.paquier@gmail.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
Nicolas Barbier wrote: > 2014-04-17 Michael Paquier <michael.paquier@gmail.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