liveBook · Manning

Variable naming

Variable naming is the practice of choosing clear, descriptive, and consistent identifiers that communicate the values or purposes they represent.

How 3 Manning books explain it

The Well-Grounded Python Developer: How the pros use Python and Flask

Meaningful naming is the practice of choosing identifiers whose words communicate the represented value, purpose, or operation.

How it is used
Improves readability and maintainability by attaching information about a value’s purpose or use to its identifier.
How deep it goes
Defines uniqueness and meaning, then demonstrates loop, employee, personal-name, and function-naming examples without exhaustive naming rules.
Examples
Uses opaque booleans, UUID identifiers, table loops, employee counts, personal names, and function names as naming comparisons.
What you can do after
Apply clearer names, refactor terse loop variables, and choose readable Python function identifiers.

Read how The Well-Grounded Python Developer: How the pros use Python and Flask explains variable naming →

Python How-To

Variable naming is the practice of choosing identifiers that clearly indicate the values or roles they represent.

How it is used
Improves readability and maintainability by making values, roles, and extracted data easier to understand.
How deep it goes
Explains naming through vague-name contrasts, calculated intermediates, and regular-expression groups, without prescribing a broader naming convention.
Examples
Uses total_score, subject_count, average_score, task_id, task_title, and task_desc as meaningful identifiers.
What you can do after
Apply it by replacing vague identifiers with names that reveal the represented data or computational role.

Read how Python How-To explains variable naming →

The Art of Code

Variable naming is the practice of choosing identifiers that accurately and consistently communicate the purpose of stored values.

How it is used
Shapes readable code by making stored values and their roles easy to understand.
How deep it goes
Explains naming patterns, scope, consistency, and cognitive load through a worked promotional-email example.
Examples
Uses promotional-email code, descriptive collection names, boolean naming, domain terms, and familiar loop-variable exceptions.
What you can do after
Apply naming and scope decisions that make intent visible and keep the main logic easy to follow.

Read how The Art of Code explains variable naming →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.