Doc #52722 [Opn->Bgs]: Don't teach beginners wrong stuff: Drop brackets around language constructs!
| From: | markskilbeck@php.net | Date: | Sun, 19 Sep 2010 14:13:04 +0000 |
| Subject: | Doc #52722 [Opn->Bgs]: Don't teach beginners wrong stuff: Drop brackets around language constructs! | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-5080@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=52722&edit=1
ID: 52722
Updated by: markskilbeck@php.net
Reported by: + at ni-po dot com
Summary: Don't teach beginners wrong stuff: Drop brackets
around language constructs!
-Status: Open
+Status: Bogus
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
Block user comment: N
New Comment:
How is it *wrong* to use parentheses with language-constructs? I don't
see that it is.
Previous Comments:
------------------------------------------------------------------------
[2010-08-28 14:15:35] + at ni-po dot com
Actually the documentation already uses a notation without parenthesis
for two language constructs: break and continue are written without
parenthesis.
------------------------------------------------------------------------
[2010-08-28 14:10:53] + at ni-po dot com
Description:
------------
One thing that very much annoys me about the PHP documentation that it
teaches beginners *wrong* stuff by writing all language constructs with
parenthesis.
Example:
If called from within a function, the return() statement immediately
ends execution of the current function [...]
And it's like this everywhere!
Admittedly all code examples use the correct syntax without parentheses.
But writing return() everywhere else in the documentation makes it seem
like the parentheses belong to the return statement and the syntax
without parenthesis is only another way to write it.
Thus I would strongly support the removal of this misleading notation.
(This obviously doesn't apply only to the return statement, but to echo,
print, include, include_once, require and require_once, too.)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52722&edit=1