Comment Code

From Hostek.com Wiki
Revision as of 05:32, 10 March 2015 by Kalebl (Talk | contribs) (Created page with "There are many different languages that use different comment structures. Some have single in-line comments. Some have multiple line comments. Many have both functions. Here ...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

There are many different languages that use different comment structures. Some have single in-line comments. Some have multiple line comments. Many have both functions.

Here are some examples of comments for code that we support on our hosting packages.

HTML

HTML only has a multiple line comment structure. But it can be used for both single lines and multiple lines.

Single Line

<!-- This is a single line of comments -->

Multiple lines

<!--
This is
multiple lines
of comments
-->

ColdFusion

ColdFusion, much like HTML, only has a multiple line comment structure as well. There is a key difference though. ColdFusion requires the three dashes ("---") rather than the two that HTML uses.

Single Line

<!--- This is a single line of comments --->

Multiple lines

<!---
This is
multiple lines
of comments
--->

PHP

PHP does have the option of two single line comment structures, or a single multiple line comments.

Single Line

// This is a single line of comments

Single Line (Shell option)

# This is a single line of comments

Multiple lines

/*
This is
multiple lines
of comments
*/

Javascript

Javascript has one convention for single lines, and one convention for multiple lines.

Single Line

// This is a single line of comments

Multiple lines

/*
This is
multiple lines
of comments
*/

CSS

CSS only has a multi line convention as well, and can be used as such.

Single Line

/* This is a single line of comments */

Multiple lines

/*
This is
multiple lines
of comments
*/