You simply indent with each level of nesting, regardless of which language you are in; for example:
<div>
<li>Quarter Pounder</li>
<?php
if ($very_hungry) { ?>
<li>French Fries</li>
<?php
} ?>
</div>This makes a dramatic difference with complex logic. For example:
That if statement on line 18 - is it inside the for loop or not? Is it inside any other if statements?
Compare with:
Here the nesting is clear.
No comments:
Post a Comment