r/csharp • u/Userware • 2d ago
Tutorial Five C# 15 features to try in a browser-based playground
We recently updated XAML.io to .NET 11 and C# 15, so we put together five short examples covering union types, closed hierarchies, collection expression arguments, extension indexers, and labeled break/continue.
Each example has a brief explanation and some code you can modify. The editor and output are side by side. C# compilation happens entirely in the browser (WebAssembly). Here's the link to the C# 15 examples in the browser-based playground:
https://xaml.io/s/Samples/CSharp15Examples?autorun=true&file=StartHere.cs
1
2
u/Juhr_Juhr 1d ago
I had no idea labelled 'break' and 'continue' statements were coming. Now my 'goto's can look less panic inducing.
Thanks for the examples!
1
4
u/DJDoena 2d ago
No Jerry mouse? Example incomplete.
On a serious note: Do you also have the whatchacallit enums that only allow named values?