note 74292 deleted from tutorial.useful by nlopess
| From: | nlopess@php.net | Date: | Tue, 03 Apr 2007 21:09:16 +0000 |
| Subject: | note 74292 deleted from tutorial.useful by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-125064@lists.php.net to get a copy of this message | ||
Note Submitter: andrew at acooke dot org
----
As an experienced (I think!) programmer, I am surprised to see "if (... != FALSE)" in an
example. My initial reaction is that this is simply bad code (if you assume that the left hand side
is boolean then it must be either true or false, and the "!= FALSE" is redundant). My
second reaction was to worry about exactly what true and false were defined as (my guess, since the
strpos looks C-like, is that FALSE is a synonym for 0 and there may be "issues" with
whether true is any non-zero value, or has some special value).
Either way, this isn't the kind of thing I want to be worrying about in the first couple of
pages of an introductory manual. I'd suggest fixing the code or explaining it in more detail.