Keep the Comments (in the Code) Coming

If you program in more than language, you know that there are different ways to write comments. Comments are useful for documenting your code. Some parts of the code will need a little explanation. Comments will be helpful for anyone viewing your code at a later date so that they understand what your program was created to do. You can also use comments when debugging. Commenting out lines of code can help you figure witch piece of your code is causing you program to not run smoothly.

Comments in an external CSS file

/*
Multi-line comment

in an external CSS file
*/

/*  Single of line comment in externall CSS file*/

Comments in an HTML Document

<!--Creating a single line comment in an HTML document -->
<!-- This is a

multi-line

comment in an HTML document -->

Comments in Javascript

//This is single comment in a javascript file

/* This is a multi-line comment in a Javascript file.
This is on two line */

C++Comment

Comments in C++ are like those in Javascript

//This is single comment in a C++ programs

/* This is a multi-line comment ina C++ program .
This is on two line */

Comments in Java

// Make a single line comment is Java

/* This Java is written

* Over multiple

lines */

Comments in Python

# Use hashtag(pound sign) to create comments in you Python program

Leave a Reply

Your email address will not be published. Required fields are marked *