Last Updated: February 25, 2016
·
454
· adamstrawson

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.