java - Should a function's comment include descriptions of work done by functions it calls? -


Assume that I have a function called displayclaimer () that puts some slashes and backslashes on the screen such as this To represent the armor of an animal: /// \\\.

  // With this line, you can write a comment for this function  
  // 3 / P> of a location but if I then displayKitten ( ) And DisplaySealion () which are displayed as part of their work performance (), how much details should be made about displaying the wings for these functions?  

On the one hand, it seems that I should be able to see the observations for displayplay (and) and I should be able to understand everything about what I have to do, in which it is actually the armor

On the other hand, if the comments for DisplayKitten () clearly refer to three slashes after three backslashes, then I would like to see the comments for the Wishers For An reading should not be anywhere else. It seems that it has to go against the feeling of encapsulation and if possible, DisplayWhiskers () has been changed later.

What is considered the best practice?

Edit: Many answers have suggested that the solution code is to be read. I consider the principle of good code as our best comment, but for this question I did not mean to mention in-code comments, but on the comments in the header files with the function prototype. Let's assume the actual code is pre-compiled and wants to use or call the client. Similarly, they should be described at the appropriate level of granulity.

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -