Discussion:
Comments?
(too old to reply)
Matthew Chan
2005-01-22 02:41:48 UTC
Permalink
Hi all,

To what extend do I have to comment my code? Can I do the following
just above my method? Or do I have to comment every line of my code?

/* Public power
* Purpose the calculate the power of the Rational number
* Input an integer n representing the power to be raised to
* Output a new Rational number calculated by the Rational number
raised to a power
*/
Gohulan
2005-01-22 04:15:40 UTC
Permalink
Post by Matthew Chan
Hi all,
To what extend do I have to comment my code? Can I do the following
just above my method? Or do I have to comment every line of my code?
/* Public power
* Purpose the calculate the power of the Rational number
* Input an integer n representing the power to be raised to
* Output a new Rational number calculated by the Rational number
raised to a power
*/
Refer to the post "commenting and the main () method" by Mohamed El
Beheiry.
Shimin Li
2005-01-22 16:24:19 UTC
Permalink
You do not need to comment every line of your code. But please keep the
following in mind: the purpose of comments is to help yourself to
understand your code, and especially to help other people read and
understand your code.

Shimin Li
Post by Matthew Chan
Hi all,
To what extend do I have to comment my code? Can I do the following
just above my method? Or do I have to comment every line of my code?
/* Public power
* Purpose the calculate the power of the Rational number
* Input an integer n representing the power to be raised to
* Output a new Rational number calculated by the Rational number
raised to a power
*/
Mazeiar Salehie
2005-01-24 20:46:40 UTC
Permalink
Hi,

It's good to put comments for each method consisting of a brief description
about its function, meaning of each parameters and what the output is.

Mazeiar
ECE250 TA
Post by Matthew Chan
Hi all,
To what extend do I have to comment my code? Can I do the following just
above my method? Or do I have to comment every line of my code?
/* Public power
* Purpose the calculate the power of the Rational number
* Input an integer n representing the power to be raised to
* Output a new Rational number calculated by the Rational number
raised to a power
*/
Loading...