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

Improve docs for std.algorithm.remove. #5548

Merged
merged 1 commit into from
Jul 5, 2017

Conversation

quickfur
Copy link
Member

@quickfur quickfur commented Jul 5, 2017

Rationale: the most common use for this function is to remove an element from an array. Therefore, the first example the user should see in the docs is how to achieve this. All the rest of the complications, like remove not changing the length of the array and what-not, should be discussed afterwards, not smack in the user's face. The current first example is a poor choice for a first example from a user's POV, because it throws a complicated case out there without first telling the reader (presumably someone new to the language, since seasoned D coders wouldn't be needing to read the docs for remove) how to accomplish the simplest, and most common, use case.

Rationale: the most common use for this function is to remove an element
from an array. Therefore, the first example the user should see in the
docs is how to achieve this.  All the rest of the complications, like
`remove` not changing the length of the array and what-not, should be
discussed *afterwards*, not smack in the user's face.  The current first
example is a poor choice for a first example from a user's POV, because
it throws a complicated case out there without first telling the reader
(presumably someone new to the language, since seasoned D coders
wouldn't be needing to read the docs for `remove`) how to accomplish the
simplest, and most common, use case.
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @quickfur!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

@quickfur
Copy link
Member Author

quickfur commented Jul 5, 2017

Also, the original forum complaint that triggered this PR: http://forum.dlang.org/thread/dmgxopawrakuvjtdtqdx@forum.dlang.org

@quickfur
Copy link
Member Author

quickfur commented Jul 5, 2017

Thanks!

@quickfur quickfur deleted the improve-docs-remove branch July 5, 2017 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants