Doc #52722 [Com]: Don't teach beginners wrong stuff: Drop brackets around language constructs!
| From: | + at ni-po dot com | Date: | Sat, 28 Aug 2010 12:15:36 +0000 |
| Subject: | Doc #52722 [Com]: 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-4946@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
Comment by: + at ni-po dot com
Reported by: + at ni-po dot com
Summary: Don't teach beginners wrong stuff: Drop brackets
around language constructs!
Status: Open
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
Block user comment: N
New Comment:
Actually the documentation already uses a notation without parenthesis
for two language constructs: break and continue are written without
parenthesis.
Previous Comments:
------------------------------------------------------------------------
[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