14
What′s new in C# 15: Overview
(pvs-studio.com)
Getting started
Useful resources
IDEs and code editors
Tools
Rules
Related communities
Wikipedia pages
I know this is something folks have been clamoring for for a long time. It looks to me, though, like you're still dealing with object casts, under the hood, so not sure how useful this will be.
Neat. Niche, but neat. I could see myself using this.
Boy, this one feels like it should have existed a decade ago. I will ABSOLUTELY be using this.
I.E. we can now polyfill Range support. Cool.
I am absolutely mindboggled by anyone who thinks this syntax is a good idea. Seriously, it's EXACTLY as verbose as the thing it's trying to replace. What problem does this solve?
Sounds neat, I guess. Doubt I'll ever use it.
How is it as verbose? It can replace multiple lines of Adds with a single bracketed expression
You mean like the "single bracketed expression" syntax we've had since... hell, I don't even know, C#4?
I think it's las about verbosity and more about maintainability. I like to use collection expressions as direct arguments because they automatically get typed based on the parameter type. Something like
ProcessEmployees([ employee, manager ]);
Now if you adjust the parameter type from List<> to HashSet<> you don't need to change anything at the call site.
That was the situation before. With that new feature I can now configure the collection more where needed.
Dunno if struct unions made it, but if they did - there should be a way to avoid boxing with
object.If they didn't make it - yeah, the feature is fucking useless 😅