header
 
     
 
pixel
pixel pixel

Commenting ends of brackets

It goes without saying that you should comment your code (it took me a while to get into the habit but eventually I learned its value). One thing a lot of programmers don't code is the ends of their brackets. This can make your code much easier to navigate down the track. For example:
<?php
// condition checking for something
if ($Variable == $SomeOtherVariable)
    {
    echo 
"Do something if condition is met";
    } 
// end of condition checking for something
?>

Unhelpful Helpful
Comments
Comment by RubiconCSL on 2005-04-28
I agree - pity most prgrammers are so lazy! If you use vi on a UNIX/LINUX box, the you can even "alias" a key to do this for you - so lazyness isn't an excuse! Also, in vi, the percent key will "balance" most types of brackets i.e. move to a closing bracket and press % and it will jump back and forward from the opening to the closing bracket. Who needs an expensive windoze gui eh. It's been there in vi all along for about 20 years! search for gvim, if you must use windoze, as it's a free windoze version. :)

Post a Comment
Name
Email
(optional)
Comment
RatingUnhelpful Helpful
Security Image* (this is just to prevent spam submissions)
Security Image