Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
hjk10157317yYou guys are a bit harsh. It seems to be pseudo code targeted toward the babysitter platform. They are usually not developers.
To make you php lovers happy, the following code will work when functions are implemented (well watch_takeover at least):
<?php
$callbacks = [
'clown',
'change_diaper',
'put_to_bed',
'contact_parent',
];
$tears = false; // will be set by external forces
$watch_baby = true;
while ($watch_baby) {
foreach($callbacks as $resolution) {
if (!$tears) {
break;
}
if (is_callable($resolution)) {
$resolution();
}
}
if (watch_takeover()) {
$watch_baby = false;
}
}
Related Rants
Read it and weep
undefined
crappy code
code illiteracy