How consistent should `PascalCase` vs lowercase naming be in `std`?
ziggit.dev·4h
🔬ROM Hacking
Preview
Report Post

December 27, 2025, 11:48pm 1

In Zig’s standard naming convention (and in many places in std) there is a clear structure:

  • StructName in the declaration of a struct
  • struct_name (or similar lowercase) in usage of that struct

A capitalized CamelCase name signals a type, while the lowercase form signals a value.

For example, inconsistencies like this appear (LSP data):

fn parse(gpa: Allocator, source: [:0]const u8, mode: Mode) Allocator.Error!Ast
(fn (Allocator, [:0]const u8, Mode) error{OutOfMemory}!Ast)

// Go to Allocator | Mode | Ast
// Result should be freed with tree.deinit() when there are
// no more references to any of the tokens or nodes.

or this (LSP data):

fn deinit(tree: *Ast, gpa: Allocator) void

// (fn (*Ast, Allocator) void)

// Go to As...

Similar Posts

Loading similar posts...