Conventions/code/naming: Difference between revisions
< Conventions | code
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
For now, this is just notes on conventions I want to use within the code. | 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 | |||
===Declaration Prefixes=== | |||
* '''c''': class | |||
* '''cs''': static class (not intended to be intantiable) | |||
* '''f''': [DEPRECATED; use namespaces instead] ferreteria class/trait/interface | |||
* '''if''': interface | |||
* '''t''': trait | |||
==Value Types== | |||
* '''cell''' means a direct value-reference | * '''cell''' means a direct value-reference | ||
* '''ref''' means a reference object (cReference) | * '''ref''' means a reference 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 | * '''status''' means a presence-info object | ||
** preferably descended from cThingHolder | ** preferably descended from cThingHolder | ||
* '''unit''' means something that knows its own name and has awareness of its container-object/structure | * '''unit''' means something that knows its own name and has awareness of its container-object/structure | ||
** preferably a PortRow Unit object | ** preferably a PortRow Unit object |
Revision as of 12:33, 8 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
Declaration Prefixes
- c: class
- cs: static class (not intended to be intantiable)
- f: [DEPRECATED; use namespaces instead] ferreteria class/trait/interface
- if: interface
- t: trait
Value Types
- cell means a direct value-reference
- ref means a reference 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