I was looking at craigslist posting for a job and it asked me to program myself as a php class. I thought this was cool and wanted to see if any YCer's wanted to give it a try. Here is me:<p><?php<p>class Auston {<p>function Auston(){
//basic stats
$age = 21;
$experience = 2.5;
$knowsajax = true;
$knowssemantichtml = true;
$knowscss = true;
$phone = '944-870-6259';
$email = 'auston.bsen@gal.cm';
}<p><pre><code> function beCreative($input){
//Does defining myself as an object constitute creativity?
$output = $input.rand($ideas, $thoughts);
return $output;
}
function learn($skill, $language){
//I love learning new things
if(isset($skill)){
$relatedinfo = $query->google($skill);
$query->storeIntoDB($relatedinfo);
}
elseif(isset($language)){
$relatedinfo = $query->google($skill);
$query->storeIntoDB($relatedinfo);
$readbook = $buybook->fromborderson($relatedinfo);
$query->storeIntoDB($readbook);
}
else{
return false;
}
}
function multitask($arrayofupto5tasks){
//I can easily manage 3-5 small tasks
$i = 0;
foreach ($arrayofupto5tasks as $value){
$query->storeIntoDB($value);
$execute->task($arrayofupto5tasks[$i]);
$i++
}
}
function deliverProjectIn($time){
$deliverytime = $time/3;
$execute->projectIn($deliverytime);
//that was a joke
}
function beAtWorkBy($time){
$wakeup = $time+3600;
$drivetowork = $wakeup+1800;
$gettowork = $drivetowork+1800;
//that was a joke
}
function showDemo(){
$arrayofsites = array('http://www.nextmoveinc.com/ycomb/heom_demo.html ', 'http://www.investorscrystalball.com', 'http://www.expeditedtravel.com/call-center/index.html' );
$site = rand(0,2);
header('Location :'.$site.');
}
</code></pre>
}<p>?>
One morning, when Gregor Samsa woke from troubled dreams,
he found himself<p>transformed in his bed into a PHP class. He lay between clumsy pointed <p>brackets, and if he lifted his head a little he could see his soft-referenced <p>underbelly, poorly indented and divided into giant blocks with redundant loops <p>and parallel data structures. The tests were hardly able to cover it and seemed<p>ready to slide off any moment. His many built-ins, pitifully feeble compared <p>to the bloated code they had to support, thrashed about helplessly <p>as he looked.
1. Your constructor has its entire contents commented out.<p>2. You should remove the $i in the function multitask(). You don't need it because the foreach is storing $arrayofupto5tasks[$i] in $value.<p><pre><code> function multitask($arrayofupto5tasks){
//I can easily manage 3-5 small tasks
$i = 0;
foreach ($arrayofupto5tasks as $value){
$query->storeIntoDB($value);
$execute->task($arrayofupto5tasks[$i]);
$i++
}
}
</code></pre>
3. It's disappointing that your showDemo() function has a hard coded number 2 in it ($site = rand(0,2);) since you could get that from the array length. And also the header() bit has an extra ' in it.<p>4. Your learn() function returns false in one case and doesn't return anything in others.