Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Documentation Guide #8

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Android Documentation Guide #8

wants to merge 4 commits into from

Conversation

BikramKoju
Copy link
Collaborator

Android Documentation Guide

@BikramKoju BikramKoju added the enhancement New feature or request label May 30, 2021
@BikramKoju BikramKoju requested a review from firefoxqb May 30, 2021 09:36
@BikramKoju BikramKoju self-assigned this May 30, 2021
Comment on lines +2 to +32
The following are useful tips and conventions for writing descriptions in doc comments.

**. Use 3rd person (descriptive) not 2nd person (prescriptive).**

The description is in 3rd person declarative rather than 2nd person imperative.
>Gets the label. (preferred)
>a
>Get the label. (avoid)

**. Method descriptions begin with a verb phrase.**

A method implements an operation, so it usually starts with a verb phrase:
>Gets the label of this button. (preferred)
>
>This method gets the label of this button.

**. Class/interface/field descriptions can omit the subject and simply state the object.**

These API often describe things rather than actions or behaviors:
>A button label. (preferred)
>
>This field is a button label. (avoid)

**. Use "this" instead of "the" when referring to an object created from the current class.**

For example, the description of the getToolkit method should read as follows:
>Gets the toolkit for this component. (preferred)
>
>Gets the toolkit for the component. (avoid)

**. OK to use phrases instead of complete sentences, in the interests of brevity.**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good practice for all comments. So may be add this part is a separate file as a general "How to write comments" rather than in just android section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants