Coding in an illusion of choice

I found this in a code written by a newbie. I thought it would be a good example about giving people false choices.

<?php if($complaint['Complaint']['status'] == 'accepted') {?>
        by <?php echo $complaint['AssignedTo']['name']; ?>
 
<?php } if($complaint['Complaint']['status'] == 'decline') {?>
        by <?php echo $complaint['AssignedTo']['name']; ?>
 
<?php } if($complaint['Complaint']['status'] == 'updated') {?>
        by <?php echo $complaint['AssignedTo']['name']; ?>
 
<?php } if($complaint['Complaint']['status'] == 'closed') {?>
        by <?php echo $complaint['AssignedTo']['name']; ?>
 
<?php
        }
?>

Funny but nearly gave me a heart attack.

2 Responses to “Coding in an illusion of choice”


  1. 1 aku_tak_tau

    ur junior wrote it?

  2. 2 Hizam Mohd

    YAN yg tulis.

    YAN – Yet Another Newbie

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*
RSS for Posts RSS for Comments