Home
Blog
Time-Saving C# Feature
Updated
Dot Net Perls

Time-Saving C# Feature

In the past I spent a significant amount of time working on large C# projects with many files. The C# language can be verbose and require excess time to create new classes—particularly several years ago.

One newer feature in C# that I feel can make developing large, multi-file programs easier is the "global using" directive. While "using" as a directive only applies to the current file, "global using" applies globally to all files in the project.

So each file that you create—like a new class file—you can omit the commonly-needed using directives. In many projects, a single directive is used in many places—like the System namespace for programs that write to the console, or System.Text for programs that use StringBuilder. I feel global using directives are a valuable time-saving (and file-size-saving) feature in this language.

Dot Net Perls is a collection of pages with code examples, which are updated to stay current. Programming is an art, and it can be learned from examples.
Donate to this site to help offset the costs of running the server. Sites like this will cease to exist if there is no financial support for them.
Sam Allen is passionate about computer languages, and he maintains 100% of the material available on this website. He hopes it makes the world a nicer place.
No updates found for this page.
Home
Changes
© 2007-2025 Sam Allen