[thelist] Chicken cam, UK

Jay Blanchard jay.blanchard at niicommunications.com
Fri May 20 14:21:39 CDT 2005


[snip]
Send someone over with a camera phone take a couple of pictures and send
them over 3 times a day if need be. It's an easy solution. 
[/snip]

http://www.subservientchicken.com/

And now, tips are owed....

<tip>
Avoid variable assignment errors when testing for values by placing the
value as the first part of the test....

TYPICAL

if($x == 0){
	$y = foo;
}

AVOIDING ASSIGNMENT ERRORS

if(0 == $x){
	$y = foo;
}

Since we assign values to variables by putting the varibale on the left
side of the equation if we do the test in the same order but fail to
complete the comparison operator properly we will have hard to identify
errors. Consider...

if($x = 0) { <------RETURNS TRUE EVERY TIME 
should be 'if($x == 0)'. If we place the value first,
'if(0 = $x)' it will return an error because of the incomplete
comparison operator, $x cannot be assigne to 0
</tip>


More information about the thelist mailing list