6

Does Solidity offer best practice to document parameters and return values of functions.

  • Similar to Java @param

  • Similar to Python Sphinx :param

3

Additionally, there is another type of comment called a natspec comment, for which the documentation is not yet written. They are written with a triple slash (///) or a double asterisk block(/** ... */) and they should be used directly above function declarations or statements. You can use Doxygen-style tags inside these comments to document functions, annotate conditions for formal verification, and provide a confirmation text which is shown to users when they attempt to invoke a function.

http://solidity.readthedocs.io/en/latest/layout-of-source-files.html?highlight=natspec

works like this:

/// @param p is a 'p' value
function init(uint p) {
1

Since solidity is more Javascript/C-like I don't see why the best practices from these languages wouldn't be acceptable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.