Tuesday, June 30, 2009

Safer IFs

I keep trying to use this form:

 if (NSNotFound == index) {

rather than the old:

 if (index == NSNotFound) {

but I keep typing the older form. Gotta teach this old dog a new trick.

P.S. The benefit is that you can't accidentally type:

 if (index = NSNotFound) {