Loadbudget

NAMING

How does a name in the code state what it names, in every language?

Binds: code, code::swift, code::python

This page states the naming rules that Swift, Python and TypeScript share. PYTHON.md and SWIFT.md state the case of a name in each language. PYTHON_TESTING.md and SWIFT_TESTING.md state the form of a test name.

A name states its intent

Chapter 2 of Clean Code by Robert C. Martin sets these rules, and section 3.16 of the Google Python Style Guide agrees with them, at https://google.github.io/styleguide/pyguide.html#s3.16-naming:

A name states what a thing is, or the interface that it offers

A name names no caller, no use and no role. A new caller then renames nothing. A package that holds an MCP server is a server, whichever client starts it. A word for an activity of one caller fails this rule, and so does a word for a role.

A language page can define a suffix for the role of a type in its layer. Such a role is part of what the type is. SWIFT_LAYERS.md defines the suffixes of Swift.

Each name passes or fails on its own

A reviewer reads one name at a time. So each rule below names a form that one name can fail.

A class name is a noun for one kind of thing

PEP 8, chapter 2 of Clean Code, the Swift API Design Guidelines and the .NET Framework Design Guidelines agree on these rules.

A test name is a sentence

A test name states the behaviour that the test proves, as one sentence.