note 74292 added to tutorial.useful
| From: | andrew at acooke dot org | Date: | Tue, 03 Apr 2007 20:42:49 +0000 |
| Subject: | note 74292 added to tutorial.useful | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-125062@lists.php.net to get a copy of this message | ||
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.
----
Server IP: 69.147.83.197
Probable Submitter: 200.120.169.16
----
Manual Page -- http://www.php.net/manual/en/tutorial.useful.php
Edit -- https://master.php.net/note/edit/74292
Del: integrated -- https://master.php.net/note/delete/74292/integrated
Del: useless -- https://master.php.net/note/delete/74292/useless
Del: bad code -- https://master.php.net/note/delete/74292/bad+code
Del: spam -- https://master.php.net/note/delete/74292/spam
Del: non-english -- https://master.php.net/note/delete/74292/non-english
Del: in docs -- https://master.php.net/note/delete/74292/in+docs
Del: other reasons-- https://master.php.net/note/delete/74292
Reject -- https://master.php.net/note/reject/74292
Search -- https://master.php.net/manage/user-notes.php