What’s new in C# 10
File-scoped namespace declaration
Seems little but it has been a useful touch for reusabilty.
As with many of the recent changes in C#9 and upcoming C#10, this change is designed to reduce “noise” in our code and make C# more readable. If you have written C#, you will recognise the format for defining the namespace our code is in:
We need those curly braces around all of our classes before we have anything else written we have at least 4 lines of code already. With file scoped namespaces, we can have the namespace defined without the need for the scoped braces: