Re: Short writage of clauses
| From: | Jochem Maas | Date: | Mon, 12 Jun 2006 10:37:15 +0000 |
| Subject: | Re: Short writage of clauses | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-237802@lists.php.net to get a copy of this message | ||
Barry wrote:
> Jochem Maas schrieb:
>> Barry wrote:
>>> Jochem Maas schrieb:
...
>
> Well i don't want the grandma to be not as old as the table and older
> than the house age and still baking a cookie.
>
> Only if all cases stated are true, i want to bake a cookie :)
then reverse the logic of the switch statement.
switch (false) {
case ($grandmaAge >= $tableAge):
case ($grandmaAge < $houseAge):
case ($grandmaAge == array_sum($grandKids)):
haveABeer();
watchFootball();
default:
bakeCookie();
break;
}
what's the obsession with baking a cookie under these very particular
circumstances anyway? ;-)
>
> ( Yeah the wm is up and running ;) )
>
>
>> f*** 'short' the time taken to write a line is negligable compared to the
>> time taken to maintain, reread, change, enhance and/or adapt it.
>
> Surely true but writing short doesn't have to mean to write unreadable
> stuff.
indeed there are no absolutes here.
>
> IF ($grandma >= $tableage
> AND < $houseage
> AND== array_sum($grandkids)
> )
> something like that (theoretically)
>