// or # ?

🚫
Exiled
Joined
Dec 18, 2006
Messages
31
Reaction score
0
This is mainly for PHP Coders, which do you use for comments?

# or // ?

I use // ..
 
Yeah // is easier, you just press // twice instead of shift+3.
 
Depends. For inline comments I use //, for function/class documentation I use this:
PHP:
So:
    /****
      string function( [int number, [string type]] )
     
      function does stuff, returns a string on success or false on faillure. 

      Dependancys: error(), dbase().

      Parameters: number is a random number, type is a string 
      denominating some type.
    
      Blablabla. 
    ****/

Saves the typing of a lot of //'s, since these descriptions can be quite long. Note that my comments tend to be in the same style as the php.net documentation, explaining dependancies, parameters and return values, and sometimes also include examples. This is good practice that allows others to use your code without having to understead all parts of it themselfs.
 
Back