dotnet / dotnet/csharplang

Proposal: File scoped namespaces

Open
#137 183 comments 341 reactions 1 assignee Claimed by @CyrusNajmabadi View on GitHub
Feature Request Implemented Needs ECMA Spec Proposal champion
Dominant language
C#
Stars
12.7k
Forks
1.1k
Avg merge
11h 1m
Merged PRs (30d)
3

Description

Spec: https://github.com/dotnet/csharplang/blob/main/proposals/csharp-10.0/file-scoped-namespaces.md

How it looks now:
```
using System;

namespace Company.Project
{
public class Product
{
...
}
}
```

Why do we need to nest our class definition in namespace ? Why not to remove extra nesting ?
Isn't that better ?

```
namespace Company.Project
using System;

public class Product
{
...
}
```

LDM history:
- https://github.com/dotnet/csharplang/blob/main/meetings/2021/LDM-2021-02-10.md#namespace-directives-in-top-level-programs
- https://github.com/dotnet/csharplang/blob/main/meetings/2021/LDM-2021-01-13.md#file-scoped-namespaces
- https://github.com/dotnet/csharplang/blob/main/meetings/2021/LDM-2021-01-05.md#file-scoped-namespaces

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.