Skip to content

Provide benefits for using alternatives#54000

Open
BillWagner wants to merge 3 commits into
dotnet:mainfrom
BillWagner:tutorial-usings
Open

Provide benefits for using alternatives#54000
BillWagner wants to merge 3 commits into
dotnet:mainfrom
BillWagner:tutorial-usings

Conversation

@BillWagner
Copy link
Copy Markdown
Member

@BillWagner BillWagner commented May 22, 2026

Fixes #52871

I didn't add the explicit usings throughout the article. Instead, I added mores text to take the reader on a journey explaining the benefits of each of the alternatives.

Finally, add a note that most of the samples in our docs assume the implicit usings are in place.


Internal previews

📄 File 🔗 Preview link
docs/csharp/fundamentals/program-structure/namespaces.md Namespaces and using directives

Fixes dotnet#52871

I didn't add the explicit usings throughout the article. Instead, I added mores text to take the reader on a journey explaining the benefits of each of the alternatives.

Finally, add a note that most of the samples in our docs assume the implicit usings are in place.
Copilot AI review requested due to automatic review settings May 22, 2026 15:20
@dotnetrepoman dotnetrepoman Bot added this to the May 2026 milestone May 22, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the C# “Namespaces and using directives” article to better explain tradeoffs among fully qualified names, file-level using directives, global usings, and implicit usings, and to clarify why many docs snippets omit explicit using statements.

Changes:

  • Expanded narrative around readability benefits and repetition reduction for using directives and global usings.
  • Added additional context around implicit usings and how they affect what you see in code snippets.
  • Adjusted guidance language around multi-namespace files.

Comment thread docs/csharp/fundamentals/program-structure/namespaces.md Outdated
Comment thread docs/csharp/fundamentals/program-structure/namespaces.md Outdated
Comment thread docs/csharp/fundamentals/program-structure/namespaces.md Outdated
BillWagner and others added 2 commits May 22, 2026 11:44
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@BillWagner BillWagner marked this pull request as ready for review May 22, 2026 15:46
@BillWagner BillWagner requested a review from a team as a code owner May 22, 2026 15:46
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.

Suggestion: Make using System; explicit in the "Using directives" example

2 participants