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:

namespace X.Y.Z

{

//more code

}

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:

namespace X.Y.Z;

//more code

Enjoy Coding…

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

How to Deploy Python Scrapy Spiders for Free on Cloud

Cloud

How Among Us Can Be Used As a Classroom Tool

Understanding the CPU and its Special Components

Introduction to Fuzzy Logic

What are Variables, Constants, Identifiers & Data Types (in JAVA)?

Azure SFTP Gateway

azure sftp

Luminous Care using LUMI will update user’s level conditions from August 27, 2021

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Serhan Ekinci

Serhan Ekinci

More from Medium

The Decorator Pattern

The Simple Guide to Porting C# Code for RestSharp Next v107 and Beyond

GIT 3-way merge

Anatomy of a GUID