Table of contents
Overview
This one is a small console app I built by hand — no AI involved, just me and Neovim on macOS. It’s a .NET 10 console app with some of the latest C# features. Pick an example from the list, see the file source code and watch it run. Nothing fancy, but it does the job of making a new language feature displayed as a reference.
What’s inside
- Extension members — the new
extension(string value) { ... }block syntax, used here to add anIsEmptyproperty and aReverse()method ontostring. - Partial constructors — a partial class declaring
public partial ConstructorExample();in one half and implementing it in the other. - Field-backed properties — the
fieldkeyword for a property that needs to touch its backing field without declaring one explicitly. - Lambda parameter modifiers without explicit types —
ref,inandouton lambda parameters, inferred rather than spelled out. Span<T>andMemory<T>— stack-allocated buffers, zero-allocation substrings, and theMemory<T>fallback for the async cases whereSpan<T>can’t go.- Examples are discovered by reflection (anything implementing
IExample) and wired up through a plainServiceCollection— no web host needed for a console app to enjoy DI. - Graceful shutdown on both
Ctrl+CandSIGTERMviaPosixSignalRegistration.
Notes
I’ve add a screenshot from my Neovim coding session to the github repo too.