Conventions/code/naming: Difference between revisions
< Conventions | code
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 9: | Line 9: | ||
===Declaration Prefixes=== | ===Declaration Prefixes=== | ||
* '''c''': class | * '''c''': class | ||
* '''cs''': static class (not intended to be | ** '''cs''': static class (not intended to be instantiable) | ||
* '''ch''': a string that is always a single character | |||
* '''f''': [DEPRECATED; use namespaces instead] ferreteria class/trait/interface | * '''f''': [DEPRECATED; use namespaces instead] ferreteria class/trait/interface | ||
* '''if''': interface | * '''if''': interface | ||
* '''t''': trait | * '''t''': trait | ||
==Value Types== | ==Value Types== | ||
* '''cell''' means a | * '''cell''' means access to a value in a named location (e.g. an array element) | ||
* '''ref''' means a [[PHP/referencing|reference]]-container object (cReference) | * '''ref''' means a [[PHP/referencing|reference]]-container object (cReference) | ||
* '''slug''' means a string which can unambiguously represent any expected value or state of a given item | * '''slug''' means a string which can unambiguously represent any expected value or state of a given item |
Revision as of 18:42, 10 October 2021
For now, this is just notes on conventions I want to use within the code.
Prefixes
Variable Prefixes
- n: a count (int); use f for float
- o: object
- or: a ref object (see Value Types)
- os: a status object (see Value Types)
Declaration Prefixes
- c: class
- cs: static class (not intended to be instantiable)
- ch: a string that is always a single character
- f: [DEPRECATED; use namespaces instead] ferreteria class/trait/interface
- if: interface
- t: trait
Value Types
- cell means access to a value in a named location (e.g. an array element)
- ref means a reference-container object (cReference)
- slug means a string which can unambiguously represent any expected value or state of a given item
- needed for representing record IDs in URLs, where one possible state is "new" (no ID yet)
- status means a presence-info object
- preferably descended from cThingHolder
- unit means something that knows its own name and has awareness of its container-object/structure
- preferably a PortRow Unit object
- value means a read-only value, assumed to exist (throws error if not)