Last update March 13, 2009

Doc Comments /
DStyle



Style Guide

Messages

Put your comments about the official/non-official page here.

It is simply wretched that the hardware tab does not match the indentation level. I have seen source code where indentation is a mix between tabs and spaces. Terrible! The hardware tab should be 4 spaces, this is not 1983 after all!

Documentation Comments

Doxygen accepts "JavaDoc"-style D comments, that look like:

/** frobnicates the foo
 * @return the result
 */
int frobnicate();

/** stores the current bar value */
int bar;

/** apply a baz to the current
 * @param foo    the value of foo
 * @param bar    the value of bar
 */
void bazify(int foo, int bar);

there is a convenient documentation short format available too:

/// frobnicates the foo
/// @return the result
int frobnicate();

int bar; ///< stores the current bar value 

/// apply a baz to the current
/// @param foo    the value of foo
/// @param bar    the value of bar
void bazify(int foo, int bar);

It would be nice if these could be mentioned in the D specification, and used in the D standard library (that would be Phobos)

Since the Ddoc (embedded documentation) feature has been added to D, the D Specification and Phobos documentation are being converted into Ddoc format. I think the conversion is either mostly done or completely done at this point. -- JustinCalvarese, 2006/12/08

Links


FrontPage | News | TestPage | MessageBoard | Search | Contributors | Folders | Index | Help | Preferences | Edit

Edit text of this page (date of last change: March 13, 2009 19:44 (diff))