| | ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot |
RecommendationsReadability of code blocksRelated lines of code should be grouped into blocks, seperated from each other to keep readability as high as possible. The definition of "related" depends on the code :) For example:
<?phpis a lot easier to read when seperated:
<?phpReturn earlyTo keep readability in functions and methods, it is wise to return early if simple conditions apply that can be checked at the beginning of a method:
<?phpIt's better to return early, keeping indentation and brain power needed to follow the code low.
<?php |
|
各種マニュアル:
PHPマニュアル |
PEARマニュアル |
Smarty(英語)マニュアル |
PHP-GTKマニュアル |
「Recommendations」をGoogle検索
|