Skip to content

Conventions

The code conventions of the library and its project files.

Code

  • C# 14 preview features (e.g., extension syntax) are used where they reduce noise.
  • Nullable reference types are enabled — respect the annotations.
  • Generic type parameters use single uppercase letters: V for value types, I for identifier types, A for attribute types.
  • I prefix for interfaces, PascalCase for classes, _camelCase for private fields, UPPER_SNAKE_CASE for constants.
  • sealed on classes that aren't designed for inheritance (e.g., Variant).

Project file conventions

Each project follows these conventions: - <TargetFramework>net11.0</TargetFramework> - <Nullable>enable</Nullable> - <ImplicitUsings>enable</ImplicitUsings> - <LangVersion>preview</LangVersion> (C# 14 preview features) - <TreatWarningsAsErrors>true</TreatWarningsAsErrors> (CI enforces clean builds) - Line width 80 characters, Allman braces, 4-space indent - File-scoped namespaces preferred

Package versions are managed centrally in Directory.Packages.props. No <Version> elements in .csproj files.