Code Style and Naming
This document defines the default naming and style rules for Beskid source code.
Primary goal: C#-style readability with consistent naming across language, stdlib, and tooling.
13.1 Naming conventions (required)
Section titled “13.1 Naming conventions (required)”Types and type-like symbols: PascalCase
Section titled “Types and type-like symbols: PascalCase”Use PascalCase for:
typenamesenumnamesenumvariantscontractnames- generic type parameters (single or short names like
T,TItem,TResult)
Examples:
pub type HttpClient { string BaseUrl,}
enum Result<TValue, TError> { Ok(TValue value), Error(TError error),}
contract Disposable { unit Dispose();}Values and callable symbols
Section titled “Values and callable symbols”Use C# conventions:
PascalCasefor function and method namescamelCasefor parameters and local variablesPascalCasefor module-level public value-like constants
Examples:
pub string FormatError(string errorCode) { let message = "Unexpected error"; return message;}
unit WriteLine(string text) { IO.Println(text);}Modules and namespaces: PascalCase
Section titled “Modules and namespaces: PascalCase”Use PascalCase for namespace/module path segments.
Examples:
IOCollectionsHashing
Avoid mixed casing styles within a namespace chain.
13.2 Acronyms
Section titled “13.2 Acronyms”Follow C#-style acronym handling:
- Two-letter acronyms are all caps in
PascalCase:IOStream. - Longer acronyms are treated as words:
HttpClient,JsonWriter,Utf8String.
For camelCase, lowercase the first letter only:
httpClientjsonWriter
13.3 File and folder naming
Section titled “13.3 File and folder naming”Use C#-style names on disk as well (no snake_case):
PascalCasefor files that define primary public symbolsPascalCasefor directories representing namespaces
Examples:
HttpClient.bdStringBuilder.bdCollections/
13.4 Visibility and API hygiene
Section titled “13.4 Visibility and API hygiene”- Default to private symbols.
- Mark only stable, intended API surface as
pub. - Keep implementation helpers private to reduce accidental coupling.
13.5 Standard library naming policy
Section titled “13.5 Standard library naming policy”- Do not use a mandatory
Stdnamespace prefix for public APIs. - Public type names:
PascalCase. - Public function and method names:
PascalCase. - Public module segments:
PascalCase. - Avoid abbreviations unless standard (
utf8,http,json).
13.6 Lint guidance (recommended)
Section titled “13.6 Lint guidance (recommended)”Tooling should eventually provide opt-in lints:
non_pascal_case_typenon_pascal_case_functionnon_camel_case_variablenon_pascal_case_module
These should start as warnings and be promotable to errors in CI.