Friday, December 2, 2011

Comments in different places

XML
<!-- your comment -->
No -- within comments, so no nested comments (for backward compatibility with SGML)
No ending in ---> (three dashes are invalid)

JSON
comments in JSON are not allowed, if really need, add some property like "_comment" in JSON object. With that, XML is better for configuration, but JSON is better for data exchange in Ajax application.

Protobuf
To add comments to your .proto files, use C/C++-style
// your comment

Thrift
.thrift files support standard shell comment #, also support c/C++ style comment or javadoc style
# your comment
/** 
your documentation (single or multiple lines)
*/
// your comment

Properties
.properties files can use the number sign (#) or the exclamation mark (!) as the first non blank character in a line to denote that all text following it, is a comment.
# your comment
! your comment

Javascript
// your single line comment
/*
your multi-line comments 
*/

HTML

<!-- your comment -->

CSS
/* your comment*/

Java
// your comment
/* your comment */
/** your documentation */

C++
/* your comment */
// your comment

ASP.NET
<%-- your comment --%>

VB.NET
' (apostrophe) your comment

C#
// your comment

No comments:

Post a Comment