简体   繁体   中英

adding to my methods quick documentation description (android studio)

Is there a way to add to a description in a methods quick documentation? I have some methods I created that I plan to use later down on the line and want to add to its quick documentation to remind myself what the method is for in case I forget, without having to go into the method itself to read comments describing what the method does.

Is there a way to add to a description in a methods quick documentation?

The best way to document your methods is giving them (and their parameters) meaningful names.

Comments should not repeat what the code expresses itself. But no generator will ever look into your head to extract your intention from there. It rather will analyze the code and build the comment based on what's already written.
Therefore (meaningful) comments cannot be generated.

There are two valid reasons why you should write comments (yourself):

  1. Interfaces

    Interfaces need (JavaDoc) comments to explain the contract behind the method, to express the callers expectation as a help for the implementer.

  2. odd ball solutions

    Is there something in your code done in an unusual way? Then add a comment why you did it so.

There might also be comments for legal reasons eg copyright marks, license texts and alike. But there should not be any other comment then this, especially nothing generated.

If you want to put comments in a single place for an entire project, or keep comments co-located with a set of files, try using a README. These are usually written in Markdown for easy conversion to beautifully formatted HTML for easier reading. Try an online markdown editor .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM