pouët.net

if ( true == x )

category: general [glöplog]
 
Now, I appreciate that if ( x == true) can unintentionally be written as if ( x = true ), but only if you avoid if ( x ) in the first place. And if ( x ) causes a warning, how about if ( !!x ).

Also, I'd much rather work with a 10,000 line source file than 100, 100 line source files.
added on the 2009-07-31 21:01:44 by dila dila
disable the warning and live happy ever after?
added on the 2009-07-31 21:06:51 by thec thec
even better: get a life.
added on the 2009-07-31 21:22:37 by decipher decipher
A life? You mean learn photoshop or milkytracker?
added on the 2009-07-31 21:37:41 by dila dila
then again, if you fuck up x==true as x=true in the first place, well...
added on the 2009-07-31 22:12:06 by Gargaj Gargaj
hobout if(bool(x)) ?
what is the question?
Quote:
Also, I'd much rather work with a 10,000 line source file than 100, 100 line source files.

Also, I'd much rather work with a language whose most prominent feature is not assisting you to shoot yourself in the foot...

(look, I can make a sentence which is even harder to parse than the original!)
added on the 2009-07-31 23:04:22 by blala blala
if (true == x) /* holy jeepers creepers! */
added on the 2009-07-31 23:15:10 by waffle waffle
if (true == !false && x != !true)
{
//uhh?
}
added on the 2009-07-31 23:42:39 by Preacher Preacher
That was: 100 files each containing 100 lines of code.

For those people who find little nuggets of logic elegant in some way.
added on the 2009-08-01 00:25:58 by dila dila
Code:while ( true == SqrtIsBusy() );
added on the 2009-08-01 00:34:58 by dila dila
if (strpos($x,$y)===false)
{
echo "not found";
}
else
{
echo "found";
}

:-)
Quote:
Also, I'd much rather work with a 10,000 line source file than 100, 100 line source files


ew.
added on the 2009-08-01 09:54:57 by smash smash
i'd prefer about 5 2000-line-files. :)
added on the 2009-08-01 11:16:20 by ryg ryg
BB Image
added on the 2009-08-01 11:28:06 by Radiant Radiant
BB Image
added on the 2009-08-01 11:29:13 by Rob Rob
if (x==(rand()==7))
added on the 2009-08-01 13:55:23 by texel texel

login