namespace
s instead of typical namespace
s CS-R1062 1using System;
2
3
4namespace csharp { 5 class p004 {
6 public bool isPalendromic(int n) {
7 string s = n.ToString();
1using System;
2
3namespace csharp { 4
5 class p003 {
6 long smallestFactor(long x) {
1using System;
2
3namespace csharp { 4 class p002 {
5 public int run() {
6 int total = 0;
1using System;
2
3namespace csharp { 4 class p001 {
5 public int run() {
6 int total = 0;
Typical namespace
s require that all the members in it be indented. With the additional of classes, methods, and scopes, the indentation level further increases, thereby affecting the code readability, navigation, and clarity. C# 10 introduces file scoped namespaces that do not require members' indentation. It is therefore recommended that you switch to file scoped namespaces when and where possible.
namespace Foo
{
// ...
}
namespace Foo;
// ...