DISCUSS
<?php
$freshies = new_files();
if (count($freshies) === 0) {
echo " <h3>there are no new photos in s3 to import.</h3>\n";
} else if (count($freshies) > 0) {
?>
[. . .]
greene
cursed, but the demons i confronted with dispersed
i am interested in this
is this a coding joke of some sort
no
do you enjoy the concept of neuroplasticity?
greene
cursed, but the demons i confronted with dispersed
i'm interested in the creation of new neural pathways because thats what my beloved binaural beat entrainment technology does
i'm familiar with neuroplasticity as i listened to a few audio seminars on the topic
greene
cursed, but the demons i confronted with dispersed
zen changes the brain
I think brains are ``plastic'', but to a limit, it's not like everyone can do anything with the proper upbringing/education/mindset ... There are limits.
cs: sure, theoretically... but how many people face the physical limits of their plasticity or are content with drawing artificial limits because they are afraid of failure?
What? :(
@ what, bt?
What's PHP got to do with neuroplasticity?
it's just the freshie code, that's all.
nny
M̮͈̣̙̰̝̃̿̎̍ͬa͉̭̥͓ț̘ͯ̈́t̬̻͖̰̞͎ͤ̇ ̈̚J̹͎̿̾ȏ̞̫͈y̭̺ͭc̦̹̟̦̭̫͊̿ͩeͥ̌̾̓ͨ
my brain is not made of plastic.
Thread delivers.
The code sucks in the cleanness department.
do tell why!
<?php
$freshies = new_files();
if (count($freshies) === 0)
{
echo "<h3>there are no new photos in s3 to import.</h3>\n";
}
else if (count($freshies) > 0)
{
?>
Yeah ^^
asemisldkfj
the law is no protection
sometimes you gotta echo stuff that looks crappy in PHP to make pretty HTML.
No need to call count() twice :)
so weasley has a different bracket coding style and doesn't like indenting html.
andre: i like adding extra cases to grab any errors. that code is followed with this:
<?php
} else {
echo " <h3>an error was encountered.</h3>\n";
};
?>php
i suppose i could do this, though:
<?php
$freshies = new_files();
if ($count = count($freshies) === 0) {
echo " <h3>there are no new photos in s3 to import.</h3>\n";
} else if ($count > 0) {
?>
[. . .]
<?php
} else {
echo " <h3>an error was encountered.</h3>\n";
};
?>
do you prefer that?
$freshies = new_files();
$count = count($freshies);
if ($count === 0) {
...
} else if ($count > 0) {
...
} else {
...
}
Can the "else" condition possibly happen though? Can count() return anything other than non-negative numbers?
http://php.net/manual/en/function.count.php
no, it can't. i need to make the cases better to handle the case when $freshies is not an array nor object.
bsdlite
thinks darkness is his ally
dude, come on guys: fuck freshies