Microsoft teases 'controversial' changes to C# programming language
The preview features are still in development and have attracted mixed feedback from the developer community


Microsoft has offered an early look at the new features coming to the C# programming language as part of the new updates to Visual Studio (Visual Studio 2022 Update 1) and the latest .NET SDK (6.0.200).
All features revealed by Microsoft this week are preview features, meaning they’re in the early stages of development and Microsoft has invited feedback from all corners of the developer community.
Said feedback has already been pouring in since the announcement, with developers specifically vocal on one of the proposed new features: Parameter Null-checking.
The feature aims to introduce a more succinct syntax for checking null values by moving the checking method code to the parameter name, replacing it simply with a !! operator.
Example code snippets above show a traditional way of checking for null values against the more succinct preview feature announced this week.
Using the new parameter operator will generate code to perform the null check, said Kathleen Dollard, principal program manager at .NET, and the generated null check will execute before any code in the method body. For constructors, the check performs before the field initialisation, calls to base constructors, and calls to these constructors.
There are a number of restrictions regarding where the syntax can be used in code, interested developers should consult the full release notes for more information.
Get the ITPro daily newsletter
Sign up today and you will receive a free copy of our Future Focus 2025 report - the leading guidance on AI, cybersecurity and other IT challenges as per 700+ senior executives
One individual commenting on Microsoft's blog post announcing the proposed change said the “syntax is ugly as hell. It adds noise to the code”.
It was one of many comments voicing mixed feelings towards the new syntax. Others criticised the new feature for making the code easier to write, but more difficult to read.
There were also suggestions that the existing notnull keyword could be used in place of the !! syntax and enhance compatibility with Nullable Reference Types – a group of features introduced in C# version 8.0 to reduce the likelihood that executed code throws an error.
Replying to commenters, Dollard said: “We’d love any feedback with alternate syntax suggestions”.
Among the other new features is an improvement to string interpolation. Both verbatim and non-verbatim string interpolation styles remain unchanged in their core behaviour, but newlines will now be allowed in the holes of interpolated strings.
“Previously, these restrictions extended to the holes of non-verbatim interpolated strings,” said Dollard. “Holes is a shorthand way of saying interpolation expressions and are the portions inside the curly braces that supply runtime values. The holes themselves are not text, and shouldn’t be held to the escaping/newline rules of the interpolated string text segments.”
The last of the new features is List Patterns, which allow developers to match elements against lists and arrays. Developers can also optionally include a slice pattern that matches zero or more elements.
For example, a pattern such as [1, 2, .., 10] will match any array of integers that contains both a 1 and a 2 at the start of the array and finishes with a 10. These arrays could have any number of additional integers in between those set conditions and still match the pattern.

Connor Jones has been at the forefront of global cyber security news coverage for the past few years, breaking developments on major stories such as LockBit’s ransomware attack on Royal Mail International, and many others. He has also made sporadic appearances on the ITPro Podcast discussing topics from home desk setups all the way to hacking systems using prosthetic limbs. He has a master’s degree in Magazine Journalism from the University of Sheffield, and has previously written for the likes of Red Bull Esports and UNILAD tech during his career that started in 2015.
-
CISA issues warning in wake of Oracle cloud credentials leak
News The security agency has published guidance for enterprises at risk
By Ross Kelly
-
Reports: White House mulling DeepSeek ban amid investigation
News Nvidia is caught up in US-China AI battle, but Huang still visits DeepSeek in Beijing
By Nicole Kobie
-
Oracle Java pricing concerns could spark a developer exodus
News Oracle Java users have raised concerns over pricing, with many considering switching to open source options.
By Solomon Klappholz
-
Python just brushed past JavaScript to become the most popular programming language on GitHub – and a key factor is that AI developers love it
News The meteoric rise of Python shows no sign of stopping
By Nicole Kobie
-
JupyterLab review: A powerful tool for documenting your data science journey
Reviews Literate programming toolkit takes dynamic code documents to new heights
By Danny Bradbury
-
Microsoft continues its Rust mission with new kernel features
News The latest critical feature comes as a "small trial" to select Windows Insiders
By Connor Jones
-
Report: Regulatory and monetary incentives needed to adopt safer programming languages
News Companies have been urged to create plans on how they intend to get rid of memory-unsafe code in their products
By Zach Marzouk
-
Microsoft Azure CTO hails 'most loved' Rust as the successor to C and C++
News Rust is a newer programming language that developers enjoy using and learning, and it's being adopted far across the industry, too
By Connor Jones
-
Programming with Python: Time to upgrade to fancy ANSI
Opinion Wordle inspires Dick to reinvent his 1980s ASCII toolkit for the 2020s, but this time he doubles down with ANSI
By Dick Pountain
-
The best Python test frameworks
Best Make your Python code shine with these testing tools
By Danny Bradbury