←
Oct 24th, 2013 at 10:10:16 am
tcr!
· Oct 24, 2013 at 10:10 am
This kind of code drives me nuts…
if (!($log->HasDownloaded())) {
// do stuff
} else {
// do other stuff
}
Just take out the extra characters to make it more legible at first glance and flip the conditional code…
if ($log->HasDownloaded()) {
// do other stuff
} else {
// do stuff
}
This is even better, no question what’s happening or when…
if ($log->has_downloaded() === TRUE)
{
// do other stuff
}
else
{
// do stuff
}
Yes, somebody else will skim your code in the future.
#devhell
← Oct 24th, 2013 at 2:10:40 pm
Oct 23rd, 2013 at 11:01:53 am →
Latest articles for #devhell
Jun 6, 2019 at 11:47 am
The function/method MUST return the number of bytes written.Why? I’m…
Jan 10, 2019 at 12:46 pm
Being a dork web developer who:
loves code
is forced to use WordPress…
Dec 1, 2018 at 12:05 pm
Good one Google.
🙄 #devhell #google
Aug 20, 2018 at 3:16 pm
Writing a valid, functional, and strict MySQL regular expression for…
Add a comment
Post