|
Delphi |
|
Delphi source code can be commented by one of three possible ways:
{ First way of comment, can be multiline }
(* Second way of comment, can be multiline *)
// Third way of comment, can be one line only
The different ways can be combined:
{ This is a (* comment *) within another comment }
Two ways of multiline comment allow to comment the multiline code, contained the multiline comments:
(*
begin
{ The following code can be deleted or commented,
if you can use both odd and even numbers }
X:=1; // set start value as odd number
Inc(X,2); // find the next odd number
end;
*)
|
|
C# |
|
There are only two ways to comment the code in C#:
/* First way of comment, can be multiline */
// Second way of comment, can be one line only
Of course, different ways can be combined:
/* This code is commented
int X = 0; // create new integer variable
*/
Unfortunately, there is no way to comment multiline code with multiline comments within.
/* commented for testing
X++;
/* < illegal!
we have to ignore X=3
due to some problems
*/
if (X == 3) X++;
*/
There is special comment started from triple backslash:
/// <summary>
/// This class represents circle funtionality.
/// </summary>
public class Circle{}
This comment allows to insert XML tags into your code. These tags are used for creating XML documentation.
|
|
There is only one multiline comment way. |
|
|
|
Special /// comment for auto-creating XML documentation. |
|
|
|
Avoid the multiline comments /**/ within you code - this will allow you to comment the large part of code when debugging. |
|
|
|
See "XML Documentation Comments" in your Visual Studio documentation for more detailed information about /// and XML tags. |
|
|
|
|
|
|
|