Q&A

Q&A with Jason Bock: What's New in C# 10

C# is inescapable. Microsoft's venerable flagship coding language consistently ranks high in popularity, recently adding half-a-million users, and is one of the top languages for desktop and game developers. With Version 10 well on its way (it'll likely be released in November alongside .NET 6), now is a good time for developers to brush up on their C# skills -- and that means learning about the most useful new and emerging features.

.NET expert and Microsoft MVP Jason Bock is an information goldmine when it comes to C#. Bock will lead a session in November's Live! 360 conference, taking place in Orlando, Fla., called "What's New in C# 10," where he'll go over the best features in the coming C# release, how best to use them, and how developers can participate in C#'s future evolution. We caught up with Bock recently and asked him his thoughts on how C# has grown over the years, and where he sees it going.

VisualStudioMagazine: What's the roadmap for C#?
Bock: When C# and .NET weren't open source, it wasn't easy to know where they were going. Now, all the design work is being done in the open. You can see what features are being proposed for a future version of C#. You can find a ton of information on C# itself.

I think one aspect to watch is C#'s evolution over time and weighing the ability to add new features with potentially breaking the language to support a desirable concept. It's not an easy problem to solve, and I'm interested to see how the C# team tackles this over time.

Broadly speaking, how has .NET's evolution over the years affected C#?
I think we're now at point where the cadence of .NET and C# align very well. We started with the .NET Framework, and then .NET Core became a thing. It started to become harder to build packages that could be used by both runtimes, so .NET Standard became a thing. Now that we have "one" .NET, I believe that it's easier to upgrade and stay current with the evolution of the language and the runtime.

"One aspect to watch is C#'s evolution over time and weighing the ability to add new features with potentially breaking the language to support a desirable concept. It's not an easy problem to solve."

Jason Bock, Microsoft MVP

What's a C# feature that you wish Microsoft would come out with, but it just hasn't materialized?
Generic attributes. This is a capability that the CLR has had for a long time, but it's never been surfaced in C#. You can define generic attributes in the intermediate language of .NET -- IL -- and consume them in C#, but you can't define them in C# directly. There are cases where I think this feature would be useful, and I'm hoping it makes it into C# at some point.

What C# 10 capability are you most excited about? Is there one that you can absolutely do without?
Static abstract members in interfaces is a preview feature, so it technically doesn't count, but developers will be able to experiment with it. I think this feature brings another level of expressivity and design capabilities.

Inside the Session

What: What's New in C# 10

When: Nov. 16, 9:15 a.m. - 10:30 a.m.

Who: Jason Bock, Developer Advocate, Rocket Mortgage

Why: "C# is an open-source, mature object oriented language, used by millions of .NET developers, yet its evolution is still underway."

Find out more about Live! 360, taking place Nov. 15-19 in Orlando, Fla.

The caller argument expression feature isn't getting as much visibility as global using directives and lambda improvements, but it'll make scenarios like logging easier to determine what was done at the call site. I have the feeling this may be used in ways that go beyond capturing the expression as a string.

How would you rate C# compared to other programming languages now?
Rating and comparing languages are a hard endeavor. They all have their strengths and weaknesses. That said, I think C# is a fine language for a couple of reasons. It's been around for over 20 years, so it has a substantial amount of usage behind it. It's cross-platform, so developers can use it on different operating systems for a wide variety of user scenarios. Finally, it's still actively being maintained by Microsoft, and will be for the foreseeable future.

Favorite version of C#. Go!
This is a hard question to answer. I feel like each version has features that are useful! That said, I'd go with Version 2, because it added generics. I can't imagine what it would be like to be coding in C# without this feature. To be fair, there are good languages that do not have the notion of generics, but it's so pervasive in C#. It's readily apparent that generics is a fundamental aspect of C#.

About the Author

Gladys Rama (@GladysRama3) is the editorial director of Converge360.

comments powered by Disqus

Featured

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

  • TypeScript Tops New JetBrains 'Language Promise Index'

    In its latest annual developer ecosystem report, JetBrains introduced a new "Language Promise Index" topped by Microsoft's TypeScript programming language.

Subscribe on YouTube