Home
Making comments in your source code

Commenting is absolutely necessary when programming. It's useful to you because you won't forget what you were doing or thinking at that time. But it's expecially useful for others because they'll know how to work with your code.

Every programming language has it's own way of making comments, which can be very annoying. Never had that you were making Java comments on your HTML page? Here's a small list of some programming languages with their way of commenting. Alltough CSS, HTML and MySQL aren't real programming languages, I posted them in this list because it can be useful for webdesigners.

Did you comment your code correct?

Take note that there could be more ways to comment your code. Just make sure you pick one universal type in all your code.

  • Actionscript

    Single line comment:
    // Comments

    Multiline comment:
    /**
    * Comments line one
    * Comments line two
    **/

  • C++

    Inline comment:
    // Comments

    Single line comment:
    /* Comments */

    Multiline comment:
    /*
    * Comments line one
    * Comments line two
    */

  • CSS

    Commenting:
    /* Comments */

  • Delphi

    Single line comment:
    // Comments

    Multiline comment:
    {
    Comments line one
    Comments line two
    }

  • HTML / XHTML / XML

    Commenting:
    <!-- Comments -->

  • Java

    Single line comment:
    // Comments

    Multiline comment:
    /**
    * Comments line one
    * Comments line two
    **/

  • MySQL

    Single line comment:
    -- Comments

    Multiline comment:
    --
    -- Comments line one
    -- Comments line two
    --

  • PHP

    Single line comment:
    // Comments

    Multiline comment:
    /*
    # Comments line one
    # Comments line two
    */



Tags:  useful tips comments programming programming languages

Interested in this topic? You might enjoy another article I've written called

Did you like this article? Subscribe to my feed or email to keep updated on new articles.

Spread the word and submit to:
Reddit!Del.icio.us!Facebook!Technorati!StumbleUpon!Newsvine!Furl!Ma.gnolia!
Comments
Add NewSearchRSS
Suru - SQL Comments   | 200.89.33.xxx | 2008-03-22 02:44:14
Gravatar image SQL

--Single Line

/*
Comment Line 1
Comment Line 2
*/
Read more...
Name:
Email:
  Gravatar enabled.
Website:
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
 
Security Image
Please input the anti-spam code that you can read in the image.
Unsubscribe from e-mail notifications.
 
< Prev   Next >
Subscribe
Navigation
Search
Search:
          
Sponsors
   



Blogrush