My programming pet hate #96
I've seen too many examples of something like this;
// Send email report upon receipt (1 = yes, 0 = no)
$send_email_report = 0;
When something like this makes more logical sense;
// Send email report upon receipt
$send_email_report = false;
If you're having to explain the value meanings in the doc, you're doing it wrong.
Also, using true/false over 1/0 makes the code much more readable, to both developers, and non-developers.
Written by adamstrawson
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Code
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#