C++ Commenting Style: IFF

gopunk

Lifer
Jul 7, 2001
29,239
2
0
okay i see that my instructors like to type "iff" instead of "if"... this happens all the time, which leads me to believe it is intentional. so is it? is it just because they're afraid somebody will uncomment it and it'll be viewed as an if statement?
 

arcain

Senior member
Oct 9, 1999
932
0
0
It is most likely intentional, though I've never seen it done in code (I program for a living). However in mathematical term IFF stands for "if, and only if".

IF you have one leg = true
I'm assuming you have two legs.. which means you definitely have one leg.

whereas

IFF you have one leg = false
Again, assuming you have two legs, since you don't only have one leg.

Mathematically, a C++ "if" is "if, and only if"

if (numLegs == 1) ...
would not be true if you had two legs.