We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://github.com/dotnet/csharplang/blob/main/proposals/csharp-10.0/file-scoped-namespaces.md
機能としてはシンプルなので説明に困ることないんだけど… https://ufcpp.net/study/csharp/sp_namespace.html の最後辺りに足せばそれで。
問題はむしろ「なんで今更?」の方で。 「1インデントと {} 1セットを削るだけの方言」みたいなところがあって、あんまり優先的に取り組まれてきてなかった文法。 top-level statements辺りから顕著に「ちょっとでも簡素に書けるようにする」の価値が上がってる。 同じ流れで global usings も同時に入ってる。
{}
背景に、Python が伸びてて、簡素な構文を好む人が増えたとかはありそう。
制限として、「1ファイル1名前空間しか持てない」ってのがある。 (さすがにファイルの途中で {} なしで名前空間が変化するのをいいとは思ってない。file-scoped namespace declaration よりも前に書けるのは extern alias, using directiev, global attribute だけだし、1ファイルに2個以上の 。file-scoped namespace は書けない。) ただ、(GitHub の public リポジトリをクロールしたりとか何らかの調査で)世の中の C# コードの 99.7% は「1ファイル1名前空間」になってることがわかってるそうなので、この制限で困ることはないはず。
The text was updated successfully, but these errors were encountered:
https://ufcpp.net/blog/2021/8/net6p7/#file-scoped-namespace
Sorry, something went wrong.
https://ufcpp.net/study/csharp/cheatsheet/ap_ver10/#file-scoped-namespace https://ufcpp.net/study/csharp/sp_namespace.html#file-scoped-namespace
No branches or pull requests
https://github.com/dotnet/csharplang/blob/main/proposals/csharp-10.0/file-scoped-namespaces.md
機能としてはシンプルなので説明に困ることないんだけど…
https://ufcpp.net/study/csharp/sp_namespace.html の最後辺りに足せばそれで。
問題はむしろ「なんで今更?」の方で。
「1インデントと
{}
1セットを削るだけの方言」みたいなところがあって、あんまり優先的に取り組まれてきてなかった文法。top-level statements辺りから顕著に「ちょっとでも簡素に書けるようにする」の価値が上がってる。
同じ流れで global usings も同時に入ってる。
背景に、Python が伸びてて、簡素な構文を好む人が増えたとかはありそう。
制限として、「1ファイル1名前空間しか持てない」ってのがある。
(さすがにファイルの途中で
{}
なしで名前空間が変化するのをいいとは思ってない。file-scoped namespace declaration よりも前に書けるのは extern alias, using directiev, global attribute だけだし、1ファイルに2個以上の 。file-scoped namespace は書けない。)ただ、(GitHub の public リポジトリをクロールしたりとか何らかの調査で)世の中の C# コードの 99.7% は「1ファイル1名前空間」になってることがわかってるそうなので、この制限で困ることはないはず。
The text was updated successfully, but these errors were encountered: