Skip to content

Remarks for Task should be modernized #8138

Open
@svick

Description

@svick

The remarks for System.Threading.Tasks.Task seem to largely originate from the .Net Framework 4.0 era and could use some modernization. Some of the issues:

  • The first thing mentioned is the Task constructor, the second is StartNew() and the fourth is RunSynchronously(). Those methods should be used only rarely, so they either should not be mentioned here at all, or at a much less prominent place.
  • Most of the examples use Wait() and not await. I think this proportion should be reversed.
  • When the example does use await, it does not explain it. For something so important to Task, I think a sentence with a link to the documentation for the keyword is the minimum.

Less important notes:

  • There's quite a few Mains in the examples, so they could benefit from using top-level statements, assuming that's acceptable.
  • The section For debugger developers documents implementation details and has incredibly niche audience. That might have been useful when .Net was not open source, but now debugger developers can read the source code, which contains the same information. So I think this section should be deleted here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Pri3Indicates issues/PRs that are low priorityarea-System.Threading.Taskshelp wantedGood for community contributors to help [up-for-grabs]

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions