<?
if ($art = 'stolen'){
echo 'ZOMG!!! Art Theif';
$action = 'taken';
}
if ($code = 'stolen'){
echo 'Meh, Who cares?';
$action = 'no action taken';
echo 'WRONG!!! CODE SHOULD BE TREATED LIKE ART!!!';
echo 'Stop Art and Code Theft now!';
}
else{
echo 'lol noob =P';
}
?>













Critiques
--
Now to the actual critique, this code is fairly verbose in the way that it's written, and could probably be simplified.
The first thing I notice is the style that you've used in your opening tags, generally, while the short open tags for php work, they do require special configuration in your php.ini. I'd recommend for full compatibility for all users that you use standard opening tags,
<?phpAnother thing about the opening and closing of your php block, is if the file only contains php code, you don't need the closing ?>, and it's recommended that you omit this to reduce chance of rendering extra white space.
Also, the code that you've written would through massive errors, as $code, $art, and $action are undefined or are missing a default value, which could cause problems for later parsing.
Thirdly, I congatulate you on the way you've tackled this problem (minus the exclaimation marks), Using a simple, logical and flow based execution is a good way to code something like this simply.
Those are just a few of my thoughts.
Previous PageNext PageThank you for your Critique
You are not logged in.