SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict delpino's Avatar
    Join Date
    Nov 2001
    Location
    London
    Posts
    335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    # or // as comment

    http://pear.sourceforge.net/en/standards.comments.php

    C style comments (/* */) and standard C++ comments (//) are both fine. Use of Perl/shell style comments (#) is discouraged.
    Anybody knows why it is discouraged? I prefer # to // because its shorter, I don't see anything wrong with it
    http://www.antosch-and-lin.com - Language Learning

  2. #2
    Web development Company chrisranjana's Avatar
    Join Date
    Jan 2001
    Location
    chennai , tamil nadu , India
    Posts
    705
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    php programming tutorials

    maybe php wants to be as far as possible different from perl.

    Chris, Programmer/Developer, Chrisranjana.com
    Chennai, Tamil Nadu, India.
    Php Developers, Ruby on Rails Developers

  3. #3
    SitePoint Wizard Mincer's Avatar
    Join Date
    Mar 2001
    Location
    London | UK
    Posts
    1,140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I wouldn't worry about it too much, do what you feel like unless you're coding for PEAR. Personally I always use /* */ comments in my code, that way you could have the line breaks in you file messed up, but the code will still work.

    Anyway, all the standards in the world wouldn't help PEAR, what they need is better code.

  4. #4
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    ###################################################
    # I have my own kooky little standard for using
    # comments in my code.
    #
    # I use the # for internal documentation including:
    # - A header at the top of each script with details
    #   like author, date, log of changes.
    # - A header to each function defined in the script
    # - And sub-headings in my code to break up and explain 
    #   logic.
    ###################################################
    
    I then use the C style comments to temporarily comment
    out code for debugging purposes
    
    //like this
    // ...
    
    
    /* and
       like
       this
    */

  5. #5
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I used to do that, but changed

    Now I use:

    PHP Code:
    /********** Script Name ************
     * Crap goes here
     * 
     * More
     *
     * more! :p
     * blah
     *************
     * Divded part
     *************
     *
     * The end
     ************************************/

    echo "SEe?"
    // $var = "TEST";
    echo $var;
    echo 
    "Didn't like $var's definiton ;) "

  6. #6
    ********* wombat firepages's Avatar
    Join Date
    Jul 2000
    Location
    Perth Australia
    Posts
    1,717
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmmmm whatever style I use the comments always appear total gibberish only a few days later....

    ...with PERL of course is that the code is gibberish as well


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •